Below find patch that fixes problem with preferred source address for
route (when deleting last address on iface that was used as preferred
source address for other route to different interface did not cause that
route to dissapear).
Please comment on this,
Karlis
--- fib_frontend.c.orig Sun Apr 29 19:38:09 2001
+++ fib_frontend.c Sun Apr 29 19:41:40 2001
@@ -528,9 +528,9 @@
#undef BRD1_OK
}
-static void fib_disable_ip(struct device *dev, int force)
+static void fib_disable_ip(struct device *dev, u32 addr, int force)
{
- if (fib_sync_down(0, dev, force))
+ if (fib_sync_down(addr, dev, force))
fib_flush();
rt_cache_flush(0);
arp_ifdown(dev);
@@ -550,7 +550,7 @@
/* Last address was deleted from this interface.
Disable IP.
*/
- fib_disable_ip(ifa->ifa_dev->dev, 1);
+ fib_disable_ip(ifa->ifa_dev->dev, ifa->ifa_local, 1);
} else {
fib_del_ifaddr(ifa);
rt_cache_flush(-1);
@@ -579,10 +579,10 @@
rt_cache_flush(-1);
break;
case NETDEV_DOWN:
- fib_disable_ip(dev, 0);
+ fib_disable_ip(dev, 0, 0);
break;
case NETDEV_UNREGISTER:
- fib_disable_ip(dev, 1);
+ fib_disable_ip(dev, 0, 1);
break;
case NETDEV_CHANGEMTU:
case NETDEV_CHANGE:
|