net: if: Fix net_if_send_data for non-l2 iface
Some services like DHCHPv4 directly send raw packets to the iface. This causes issue when the iface does not implement l2, e.g. because it is a socket offload interface. fix that. Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
This commit is contained in:
parent
6915adf899
commit
f1a7a53850
1 changed files with 6 additions and 0 deletions
|
@ -356,6 +356,12 @@ enum net_verdict net_if_send_data(struct net_if *iface, struct net_pkt *pkt)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IS_ENABLED(CONFIG_NET_OFFLOAD) && !net_if_l2(iface)) {
|
||||||
|
NET_WARN("no l2 for iface %p, discard pkt", iface);
|
||||||
|
verdict = NET_DROP;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
/* If the ll address is not set at all, then we must set
|
/* If the ll address is not set at all, then we must set
|
||||||
* it here.
|
* it here.
|
||||||
* Workaround Linux bug, see:
|
* Workaround Linux bug, see:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue