net: ip: Add cloning of missing attributes

A few attributes isn't cloned togerder with pkt.
This commit add missing part.
Additionally, because the `eof` flag in net_pkt structure is
avilable unconditionally hence `#if defined(CONFIG_NET_SOCKETS)`
guard has been removed form setter and getter functions for
this flag.

Signed-off-by: Marcin Gasiorek <marcin.gasiorek@nordicsemi.no>
This commit is contained in:
Marcin Gasiorek 2023-09-21 10:30:55 +02:00 committed by Carles Cufí
parent a3cde71fbb
commit c668fbc4d2
2 changed files with 3 additions and 2 deletions

View file

@ -465,7 +465,6 @@ static inline void net_pkt_set_tcp_1st_msg(struct net_pkt *pkt, bool is_1st)
#endif
}
#if defined(CONFIG_NET_SOCKETS)
static inline uint8_t net_pkt_eof(struct net_pkt *pkt)
{
return pkt->eof;
@ -475,7 +474,6 @@ static inline void net_pkt_set_eof(struct net_pkt *pkt, bool eof)
{
pkt->eof = eof;
}
#endif
static inline bool net_pkt_forwarding(struct net_pkt *pkt)
{

View file

@ -1809,6 +1809,9 @@ static void clone_pkt_attributes(struct net_pkt *pkt, struct net_pkt *clone_pkt)
net_pkt_set_priority(clone_pkt, net_pkt_priority(pkt));
net_pkt_set_orig_iface(clone_pkt, net_pkt_orig_iface(pkt));
net_pkt_set_captured(clone_pkt, net_pkt_is_captured(pkt));
net_pkt_set_eof(clone_pkt, net_pkt_eof(pkt));
net_pkt_set_ptp(clone_pkt, net_pkt_is_ptp(pkt));
net_pkt_set_forwarding(clone_pkt, net_pkt_forwarding(pkt));
net_pkt_set_l2_bridged(clone_pkt, net_pkt_is_l2_bridged(pkt));
net_pkt_set_l2_processed(clone_pkt, net_pkt_is_l2_processed(pkt));