net: route: Skip lladdr check for ppp
ppp does not populate the lladdr fields in the received packet. To enable routing for packets received on the ppp interface, the check of the link layer addresses in the packet must be skipped. Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
This commit is contained in:
parent
d77fbcb86a
commit
0b849744cd
1 changed files with 19 additions and 11 deletions
|
@ -789,20 +789,28 @@ int net_route_packet(struct net_pkt *pkt, struct in6_addr *nexthop)
|
|||
* network technologies enabled.
|
||||
*/
|
||||
if (net_if_l2(net_pkt_iface(pkt)) != &NET_L2_GET_NAME(DUMMY)) {
|
||||
#endif
|
||||
#if defined(CONFIG_NET_L2_PPP)
|
||||
/* PPP does not populate the lladdr fields */
|
||||
if (net_if_l2(net_pkt_iface(pkt)) != &NET_L2_GET_NAME(PPP)) {
|
||||
#endif
|
||||
if (!net_pkt_lladdr_src(pkt)->addr) {
|
||||
NET_DBG("Link layer source address not set");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Sanitycheck: If src and dst ll addresses are going to be
|
||||
* same, then something went wrong in route lookup.
|
||||
/* Sanitycheck: If src and dst ll addresses are going
|
||||
* to be same, then something went wrong in route
|
||||
* lookup.
|
||||
*/
|
||||
if (!memcmp(net_pkt_lladdr_src(pkt)->addr, lladdr->addr,
|
||||
lladdr->len)) {
|
||||
NET_ERR("Src ll and Dst ll are same");
|
||||
return -EINVAL;
|
||||
}
|
||||
#if defined(CONFIG_NET_L2_PPP)
|
||||
}
|
||||
#endif
|
||||
#if defined(CONFIG_NET_L2_DUMMY)
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue