diff options
author | Michael Brown <mcb30@etherboot.org> | 2009-11-14 03:02:16 +0000 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2009-11-16 22:12:48 +0000 |
commit | 4933ccbf654c27e3260e71bae7ade8286f69193a (patch) | |
tree | 08971af57361e864a96926a908d1e1a2f1b78fc6 /src/net/ipv4.c | |
parent | 55d23b19a270b2caeb4dcd9435a91bc9c55383e2 (diff) | |
download | ipxe-4933ccbf654c27e3260e71bae7ade8286f69193a.zip ipxe-4933ccbf654c27e3260e71bae7ade8286f69193a.tar.gz ipxe-4933ccbf654c27e3260e71bae7ade8286f69193a.tar.bz2 |
[ipv4] Ignore non-open net devices when performing routing
We do not discard routing table entries when closing an interface. It
is plausible that multiple interfaces may be on the same physical
network; if so, then we may end up in a situation whereby outbound
packets attempt to route via a closed interface.
Fix by ignoring non-open net devices in ipv4_route().
Diffstat (limited to 'src/net/ipv4.c')
-rw-r--r-- | src/net/ipv4.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/net/ipv4.c b/src/net/ipv4.c index 6b78ad7..4c1393f 100644 --- a/src/net/ipv4.c +++ b/src/net/ipv4.c @@ -118,6 +118,8 @@ static struct ipv4_miniroute * ipv4_route ( struct in_addr *dest ) { /* Find first usable route in routing table */ list_for_each_entry ( miniroute, &ipv4_miniroutes, list ) { + if ( ! ( miniroute->netdev->state & NETDEV_OPEN ) ) + continue; local = ( ( ( dest->s_addr ^ miniroute->address.s_addr ) & miniroute->netmask.s_addr ) == 0 ); has_gw = ( miniroute->gateway.s_addr ); |