summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipip.c
diff options
context:
space:
mode:
authorNicolas Dichtel <nicolas.dichtel@6wind.com>2012-11-14 00:14:01 -0500
committerDavid S. Miller <davem@davemloft.net>2012-11-14 22:02:38 -0500
commitc38cc4b599c2fe5815af4b0c6acac48e904977b4 (patch)
tree3369e3c01bb146374626fd2e53fa6623ed394f78 /net/ipv4/ipip.c
parent0b112457229d8a17198a02f3cca32922d2e374f1 (diff)
ipip: 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 ipip 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/ipv4/ipip.c')
-rw-r--r--net/ipv4/ipip.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 099fc1c428b4..4be88cc98957 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -680,29 +680,27 @@ ipip_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
680 break; 680 break;
681 } 681 }
682 t = netdev_priv(dev); 682 t = netdev_priv(dev);
683 ipip_tunnel_unlink(ipn, t);
684 synchronize_net();
685 t->parms.iph.saddr = p.iph.saddr;
686 t->parms.iph.daddr = p.iph.daddr;
687 memcpy(dev->dev_addr, &p.iph.saddr, 4);
688 memcpy(dev->broadcast, &p.iph.daddr, 4);
689 ipip_tunnel_link(ipn, t);
690 netdev_state_change(dev);
691 } 683 }
684
685 ipip_tunnel_unlink(ipn, t);
686 synchronize_net();
687 t->parms.iph.saddr = p.iph.saddr;
688 t->parms.iph.daddr = p.iph.daddr;
689 memcpy(dev->dev_addr, &p.iph.saddr, 4);
690 memcpy(dev->broadcast, &p.iph.daddr, 4);
691 ipip_tunnel_link(ipn, t);
692 t->parms.iph.ttl = p.iph.ttl;
693 t->parms.iph.tos = p.iph.tos;
694 t->parms.iph.frag_off = p.iph.frag_off;
695 if (t->parms.link != p.link) {
696 t->parms.link = p.link;
697 ipip_tunnel_bind_dev(dev);
698 }
699 netdev_state_change(dev);
692 } 700 }
693 701
694 if (t) { 702 if (t) {
695 err = 0; 703 err = 0;
696 if (cmd == SIOCCHGTUNNEL) {
697 t->parms.iph.ttl = p.iph.ttl;
698 t->parms.iph.tos = p.iph.tos;
699 t->parms.iph.frag_off = p.iph.frag_off;
700 if (t->parms.link != p.link) {
701 t->parms.link = p.link;
702 ipip_tunnel_bind_dev(dev);
703 netdev_state_change(dev);
704 }
705 }
706 if (copy_to_user(ifr->ifr_ifru.ifru_data, &t->parms, sizeof(p))) 704 if (copy_to_user(ifr->ifr_ifru.ifru_data, &t->parms, sizeof(p)))
707 err = -EFAULT; 705 err = -EFAULT;
708 } else 706 } else