diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2012-11-14 05:14:04 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-11-14 22:02:38 -0500 |
commit | f9cd5a5536cacc254cd6bd1d8b736a02726ab24a (patch) | |
tree | 510fc8d801e077581057013a04750a728dcf8997 /net/ipv6 | |
parent | be42da0e1012bf67d8f6899b7d9162e35527da4b (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>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/sit.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 5bce2f698044..cd6a2b2d766a 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) break; } t = netdev_priv(dev); - ipip6_tunnel_unlink(sitn, t); - synchronize_net(); - t->parms.iph.saddr = p.iph.saddr; - t->parms.iph.daddr = p.iph.daddr; - memcpy(dev->dev_addr, &p.iph.saddr, 4); - memcpy(dev->broadcast, &p.iph.daddr, 4); - ipip6_tunnel_link(sitn, t); - netdev_state_change(dev); } + + ipip6_tunnel_unlink(sitn, t); + synchronize_net(); + t->parms.iph.saddr = p.iph.saddr; + t->parms.iph.daddr = p.iph.daddr; + memcpy(dev->dev_addr, &p.iph.saddr, 4); + memcpy(dev->broadcast, &p.iph.daddr, 4); + ipip6_tunnel_link(sitn, t); + t->parms.iph.ttl = p.iph.ttl; + t->parms.iph.tos = p.iph.tos; + if (t->parms.link != p.link) { + t->parms.link = p.link; + ipip6_tunnel_bind_dev(dev); + } + netdev_state_change(dev); } if (t) { err = 0; - if (cmd == SIOCCHGTUNNEL) { - t->parms.iph.ttl = p.iph.ttl; - t->parms.iph.tos = p.iph.tos; - if (t->parms.link != p.link) { - t->parms.link = p.link; - ipip6_tunnel_bind_dev(dev); - netdev_state_change(dev); - } - } if (copy_to_user(ifr->ifr_ifru.ifru_data, &t->parms, sizeof(p))) err = -EFAULT; } else |