diff options
author | David S. Miller <davem@davemloft.net> | 2011-02-19 22:17:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-19 22:17:35 -0500 |
commit | da935c66bacb3ed9ada984b053297f87c2dff63a (patch) | |
tree | 46278da2b312c73f1375b830d7e5912bf23abd78 /net/ipv4/devinet.c | |
parent | 9435eb1cf0b76b323019cebf8d16762a50a12a19 (diff) | |
parent | 2205a6ea93fea76f88b43727fea53f3ce3790d6f (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
Documentation/feature-removal-schedule.txt
drivers/net/e1000e/netdev.c
net/xfrm/xfrm_policy.c
Diffstat (limited to 'net/ipv4/devinet.c')
-rw-r--r-- | net/ipv4/devinet.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index ee144a4fca41..90389281d97a 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1102,6 +1102,21 @@ static inline bool inetdev_valid_mtu(unsigned mtu) | |||
1102 | return mtu >= 68; | 1102 | return mtu >= 68; |
1103 | } | 1103 | } |
1104 | 1104 | ||
1105 | static void inetdev_send_gratuitous_arp(struct net_device *dev, | ||
1106 | struct in_device *in_dev) | ||
1107 | |||
1108 | { | ||
1109 | struct in_ifaddr *ifa = in_dev->ifa_list; | ||
1110 | |||
1111 | if (!ifa) | ||
1112 | return; | ||
1113 | |||
1114 | arp_send(ARPOP_REQUEST, ETH_P_ARP, | ||
1115 | ifa->ifa_address, dev, | ||
1116 | ifa->ifa_address, NULL, | ||
1117 | dev->dev_addr, NULL); | ||
1118 | } | ||
1119 | |||
1105 | /* Called only under RTNL semaphore */ | 1120 | /* Called only under RTNL semaphore */ |
1106 | 1121 | ||
1107 | static int inetdev_event(struct notifier_block *this, unsigned long event, | 1122 | static int inetdev_event(struct notifier_block *this, unsigned long event, |
@@ -1155,18 +1170,13 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, | |||
1155 | } | 1170 | } |
1156 | ip_mc_up(in_dev); | 1171 | ip_mc_up(in_dev); |
1157 | /* fall through */ | 1172 | /* fall through */ |
1158 | case NETDEV_NOTIFY_PEERS: | ||
1159 | case NETDEV_CHANGEADDR: | 1173 | case NETDEV_CHANGEADDR: |
1174 | if (!IN_DEV_ARP_NOTIFY(in_dev)) | ||
1175 | break; | ||
1176 | /* fall through */ | ||
1177 | case NETDEV_NOTIFY_PEERS: | ||
1160 | /* Send gratuitous ARP to notify of link change */ | 1178 | /* Send gratuitous ARP to notify of link change */ |
1161 | if (IN_DEV_ARP_NOTIFY(in_dev)) { | 1179 | inetdev_send_gratuitous_arp(dev, in_dev); |
1162 | struct in_ifaddr *ifa = in_dev->ifa_list; | ||
1163 | |||
1164 | if (ifa) | ||
1165 | arp_send(ARPOP_REQUEST, ETH_P_ARP, | ||
1166 | ifa->ifa_address, dev, | ||
1167 | ifa->ifa_address, NULL, | ||
1168 | dev->dev_addr, NULL); | ||
1169 | } | ||
1170 | break; | 1180 | break; |
1171 | case NETDEV_DOWN: | 1181 | case NETDEV_DOWN: |
1172 | ip_mc_down(in_dev); | 1182 | ip_mc_down(in_dev); |