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
|
@ -790,19 +790,27 @@ int net_route_packet(struct net_pkt *pkt, struct in6_addr *nexthop)
|
||||||
*/
|
*/
|
||||||
if (net_if_l2(net_pkt_iface(pkt)) != &NET_L2_GET_NAME(DUMMY)) {
|
if (net_if_l2(net_pkt_iface(pkt)) != &NET_L2_GET_NAME(DUMMY)) {
|
||||||
#endif
|
#endif
|
||||||
if (!net_pkt_lladdr_src(pkt)->addr) {
|
#if defined(CONFIG_NET_L2_PPP)
|
||||||
NET_DBG("Link layer source address not set");
|
/* PPP does not populate the lladdr fields */
|
||||||
return -EINVAL;
|
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
|
/* Sanitycheck: If src and dst ll addresses are going
|
||||||
* same, then something went wrong in route lookup.
|
* to be same, then something went wrong in route
|
||||||
*/
|
* lookup.
|
||||||
if (!memcmp(net_pkt_lladdr_src(pkt)->addr, lladdr->addr,
|
*/
|
||||||
lladdr->len)) {
|
if (!memcmp(net_pkt_lladdr_src(pkt)->addr, lladdr->addr,
|
||||||
NET_ERR("Src ll and Dst ll are same");
|
lladdr->len)) {
|
||||||
return -EINVAL;
|
NET_ERR("Src ll and Dst ll are same");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
#if defined(CONFIG_NET_L2_PPP)
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#if defined(CONFIG_NET_L2_DUMMY)
|
#if defined(CONFIG_NET_L2_DUMMY)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue