Skip to content

Commit b212fb9

Browse files
JordanYateskartben
authored andcommitted
net: ip: net_pkt: conditional net_if_get_by_iface
Don't reference `net_if_get_by_iface` if `CONFIG_NET_RAW_MODE=y`, since `net_if.c` is not compiled in that case, leading to linker errors. Signed-off-by: Jordan Yates <jordan@embeint.com>
1 parent e80d86a commit b212fb9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

subsys/net/ip/net_pkt.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,12 @@ pkt_alloc_with_buffer(struct k_mem_slab *slab,
16651665
struct net_pkt *pkt;
16661666
int ret;
16671667

1668+
#ifdef CONFIG_NET_RAW_MODE
1669+
/* net_if_get_by_iface is not available in raw mode */
1670+
NET_DBG("On iface N/A (%p) size %zu", iface, size);
1671+
#else
16681672
NET_DBG("On iface %d (%p) size %zu", net_if_get_by_iface(iface), iface, size);
1673+
#endif /* CONFIG_NET_RAW_MODE */
16691674

16701675
#if NET_LOG_LEVEL >= LOG_LEVEL_DBG
16711676
pkt = pkt_alloc_on_iface(slab, iface, timeout, caller, line);

0 commit comments

Comments
 (0)