Skip to content

Commit cd4b854

Browse files
jukkarcarlescufi
authored andcommitted
net: bridge: Ignore promisc mode errors for native-sim
We do not need promiscuous mode setting in host side when testing bridging with native-sim, so just ignore errors in this case. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 98a21a8 commit cd4b854

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

subsys/net/l2/ethernet/bridge.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,16 @@ int eth_bridge_iface_add(struct net_if *br, struct net_if *iface)
136136

137137
ret = net_eth_promisc_mode(iface, true);
138138
if (ret != 0 && ret != -EALREADY) {
139-
NET_DBG("iface %d promiscuous mode failed: %d",
140-
net_if_get_by_iface(iface), ret);
141-
eth_bridge_iface_remove(br, iface);
142-
return ret;
139+
/* Ignore any errors when using native-sim driver,
140+
* we do not need host promiscuous working when testing
141+
* bridging using native-sim.
142+
*/
143+
if (!IS_ENABLED(CONFIG_ETH_NATIVE_POSIX)) {
144+
NET_DBG("iface %d promiscuous mode failed: %d",
145+
net_if_get_by_iface(iface), ret);
146+
eth_bridge_iface_remove(br, iface);
147+
return ret;
148+
}
143149
}
144150

145151
NET_DBG("iface %d added to bridge %d", net_if_get_by_iface(iface),

0 commit comments

Comments
 (0)