Commit f9cd5a55 authored by Nicolas Dichtel's avatar Nicolas Dichtel Committed by David S. Miller

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: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent be42da0e
...@@ -978,6 +978,8 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -978,6 +978,8 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
break; break;
} }
t = netdev_priv(dev); t = netdev_priv(dev);
}
ipip6_tunnel_unlink(sitn, t); ipip6_tunnel_unlink(sitn, t);
synchronize_net(); synchronize_net();
t->parms.iph.saddr = p.iph.saddr; t->parms.iph.saddr = p.iph.saddr;
...@@ -985,21 +987,17 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -985,21 +987,17 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
memcpy(dev->dev_addr, &p.iph.saddr, 4); memcpy(dev->dev_addr, &p.iph.saddr, 4);
memcpy(dev->broadcast, &p.iph.daddr, 4); memcpy(dev->broadcast, &p.iph.daddr, 4);
ipip6_tunnel_link(sitn, t); ipip6_tunnel_link(sitn, t);
netdev_state_change(dev);
}
}
if (t) {
err = 0;
if (cmd == SIOCCHGTUNNEL) {
t->parms.iph.ttl = p.iph.ttl; t->parms.iph.ttl = p.iph.ttl;
t->parms.iph.tos = p.iph.tos; t->parms.iph.tos = p.iph.tos;
if (t->parms.link != p.link) { if (t->parms.link != p.link) {
t->parms.link = p.link; t->parms.link = p.link;
ipip6_tunnel_bind_dev(dev); ipip6_tunnel_bind_dev(dev);
netdev_state_change(dev);
} }
netdev_state_change(dev);
} }
if (t) {
err = 0;
if (copy_to_user(ifr->ifr_ifru.ifru_data, &t->parms, sizeof(p))) if (copy_to_user(ifr->ifr_ifru.ifru_data, &t->parms, sizeof(p)))
err = -EFAULT; err = -EFAULT;
} else } else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment