Skip to content

Commit 9838a03

Browse files
thugheskartben
authored andcommitted
net: l2: ethernet: Fix unused function warning
Building with clang warns: subsys/net/l2/ethernet/ethernet.c:178:18: error: unused function 'ethernet_check_ipv4_bcast_addr' [-Werror,-Wunused-function] enum net_verdict ethernet_check_ipv4_bcast_addr(struct net_pkt *pkt, ^ ethernet_check_ipv4_bcast_addr is called by ethernet_ip_recv, which only exists when CONFIG_NET_IPV4 or CONFIG_NET_IPV6 is defined. Signed-off-by: Tom Hughes <[email protected]>
1 parent 4aefbbe commit 9838a03

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

subsys/net/l2/ethernet/ethernet.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ static inline bool eth_is_vlan_tag_stripped(struct net_if *iface)
171171
return (net_eth_get_hw_capabilities(iface) & ETHERNET_HW_VLAN_TAG_STRIP);
172172
}
173173

174+
#if defined(CONFIG_NET_IPV4) || defined(CONFIG_NET_IPV6)
174175
/* Drop packet if it has broadcast destination MAC address but the IP
175176
* address is not multicast or broadcast address. See RFC 1122 ch 3.3.6
176177
*/
@@ -191,6 +192,7 @@ enum net_verdict ethernet_check_ipv4_bcast_addr(struct net_pkt *pkt,
191192

192193
return NET_OK;
193194
}
195+
#endif
194196

195197
#if defined(CONFIG_NET_NATIVE_IP) && !defined(CONFIG_NET_RAW_MODE)
196198
static void ethernet_mcast_monitor_cb(struct net_if *iface, const struct net_addr *addr,

0 commit comments

Comments
 (0)