mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-05 22:29:49 +00:00
ip4: routing: check peer for point to point interfaces
gw netif field for point to point interfaces is the peer IP address. Check if the destination is equals to the gw field of point to point interfaces (broadcast flag is not set) when routing an IP packet.
This commit is contained in:
parent
715d8d3881
commit
8b2c73de4e
@ -177,6 +177,11 @@ ip4_route(const ip4_addr_t *dest)
|
||||
/* return netif on which to forward IP packet */
|
||||
return netif;
|
||||
}
|
||||
/* gateway matches on a non broadcast interface? (i.e. peer in a point to point interface) */
|
||||
if ((netif->flags & NETIF_FLAG_BROADCAST) == 0 && ip4_addr_cmp(dest, netif_ip4_gw(netif))) {
|
||||
/* return netif on which to forward IP packet */
|
||||
return netif;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user