aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Dichtel <nicolas.dichtel@6wind.com>2012-11-14 00:14:04 -0500
committerDavid S. Miller <davem@davemloft.net>2012-11-14 22:02:38 -0500
commitf9cd5a5536cacc254cd6bd1d8b736a02726ab24a (patch)
tree510fc8d801e077581057013a04750a728dcf8997
parentbe42da0e1012bf67d8f6899b7d9162e35527da4b (diff)
sit: always notify change when params are updated
netdev_state_change() was called only when end points or link was updated. Now that all parameters are advertised via netlink, we must advertise any change. This patch also prepares the support of sit tunnels management via rtnl. The code which update tunnels will be put in a new function. Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv6/sit.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 5bce2f69804..cd6a2b2d766 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -978,28 +978,26 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
978 break; 978 break;
979 } 979 }
980 t = netdev_priv(dev); 980 t = netdev_priv(dev);
981 ipip6_tunnel_unlink(sitn, t);
982 synchronize_net();
983 t->parms.iph.saddr = p.iph.saddr;
984 t->parms.iph.daddr = p.iph.daddr;
985 memcpy(dev->dev_addr, &p.iph.saddr, 4);
986 memcpy(dev->broadcast, &p.iph.daddr, 4);
987 ipip6_tunnel_link(sitn, t);
988 netdev_state_change(dev);
989 } 981 }
982
983 ipip6_tunnel_unlink(sitn, t);
984 synchronize_net();
985 t->parms.iph.saddr = p.iph.saddr;
986 t->parms.iph.daddr = p.iph.daddr;
987 memcpy(dev->dev_addr, &p.iph.saddr, 4);
988 memcpy(dev->broadcast, &p.iph.daddr, 4);
989 ipip6_tunnel_link(sitn, t);
990 t->parms.iph.ttl = p.iph.ttl;
991 t->parms.iph.tos = p.iph.tos;
992 if (t->parms.link != p.link) {
993 t->parms.link = p.link;
994 ipip6_tunnel_bind_dev(dev);
995 }
996 netdev_state_change(dev);
990 } 997 }
991 998
992 if (t) { 999 if (t) {
993 err = 0; 1000 err = 0;
994 if (cmd == SIOCCHGTUNNEL) {
995 t->parms.iph.ttl = p.iph.ttl;
996 t->parms.iph.tos = p.iph.tos;
997 if (t->parms.link != p.link) {
998 t->parms.link = p.link;
999 ipip6_tunnel_bind_dev(dev);
1000 netdev_state_change(dev);
1001 }
1002 }
1003 if (copy_to_user(ifr->ifr_ifru.ifru_data, &t->parms, sizeof(p))) 1001 if (copy_to_user(ifr->ifr_ifru.ifru_data, &t->parms, sizeof(p)))
1004 err = -EFAULT; 1002 err = -EFAULT;
1005 } else 1003 } else