aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_frontend.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-07-05 22:00:44 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-05 22:00:44 -0400
commit76e6ebfb40a2455c18234dcb0f9df37533215461 (patch)
treef3b435e8b27a297f330fc7d497a0ef44022e7239 /net/ipv4/fib_frontend.c
parentf43798c27684ab925adde7d8acc34c78c6e50df8 (diff)
netns: add namespace parameter to rt_cache_flush
Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_frontend.c')
-rw-r--r--net/ipv4/fib_frontend.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 5ad01d63f83b..65c1503f8cc8 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -144,7 +144,7 @@ static void fib_flush(struct net *net)
144 } 144 }
145 145
146 if (flushed) 146 if (flushed)
147 rt_cache_flush(-1); 147 rt_cache_flush(net, -1);
148} 148}
149 149
150/* 150/*
@@ -897,21 +897,22 @@ static void fib_disable_ip(struct net_device *dev, int force)
897{ 897{
898 if (fib_sync_down_dev(dev, force)) 898 if (fib_sync_down_dev(dev, force))
899 fib_flush(dev_net(dev)); 899 fib_flush(dev_net(dev));
900 rt_cache_flush(0); 900 rt_cache_flush(dev_net(dev), 0);
901 arp_ifdown(dev); 901 arp_ifdown(dev);
902} 902}
903 903
904static int fib_inetaddr_event(struct notifier_block *this, unsigned long event, void *ptr) 904static int fib_inetaddr_event(struct notifier_block *this, unsigned long event, void *ptr)
905{ 905{
906 struct in_ifaddr *ifa = (struct in_ifaddr*)ptr; 906 struct in_ifaddr *ifa = (struct in_ifaddr*)ptr;
907 struct net_device *dev = ifa->ifa_dev->dev;
907 908
908 switch (event) { 909 switch (event) {
909 case NETDEV_UP: 910 case NETDEV_UP:
910 fib_add_ifaddr(ifa); 911 fib_add_ifaddr(ifa);
911#ifdef CONFIG_IP_ROUTE_MULTIPATH 912#ifdef CONFIG_IP_ROUTE_MULTIPATH
912 fib_sync_up(ifa->ifa_dev->dev); 913 fib_sync_up(dev);
913#endif 914#endif
914 rt_cache_flush(-1); 915 rt_cache_flush(dev_net(dev), -1);
915 break; 916 break;
916 case NETDEV_DOWN: 917 case NETDEV_DOWN:
917 fib_del_ifaddr(ifa); 918 fib_del_ifaddr(ifa);
@@ -919,9 +920,9 @@ static int fib_inetaddr_event(struct notifier_block *this, unsigned long event,
919 /* Last address was deleted from this interface. 920 /* Last address was deleted from this interface.
920 Disable IP. 921 Disable IP.
921 */ 922 */
922 fib_disable_ip(ifa->ifa_dev->dev, 1); 923 fib_disable_ip(dev, 1);
923 } else { 924 } else {
924 rt_cache_flush(-1); 925 rt_cache_flush(dev_net(dev), -1);
925 } 926 }
926 break; 927 break;
927 } 928 }
@@ -949,14 +950,14 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo
949#ifdef CONFIG_IP_ROUTE_MULTIPATH 950#ifdef CONFIG_IP_ROUTE_MULTIPATH
950 fib_sync_up(dev); 951 fib_sync_up(dev);
951#endif 952#endif
952 rt_cache_flush(-1); 953 rt_cache_flush(dev_net(dev), -1);
953 break; 954 break;
954 case NETDEV_DOWN: 955 case NETDEV_DOWN:
955 fib_disable_ip(dev, 0); 956 fib_disable_ip(dev, 0);
956 break; 957 break;
957 case NETDEV_CHANGEMTU: 958 case NETDEV_CHANGEMTU:
958 case NETDEV_CHANGE: 959 case NETDEV_CHANGE:
959 rt_cache_flush(0); 960 rt_cache_flush(dev_net(dev), 0);
960 break; 961 break;
961 } 962 }
962 return NOTIFY_DONE; 963 return NOTIFY_DONE;