aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-04-12 17:03:20 -0400
committerDavid S. Miller <davem@davemloft.net>2014-04-12 17:03:20 -0400
commiteda43ce03919f2b929a884fddbefa98cfb04fec9 (patch)
treef48369e48fdf6aec5d1916537e6f08574e0526d0 /net
parent810d8cedcc880dca8b64e05fe1331ab5d4f8d992 (diff)
parent8d89dcdf80d88007647945a753821a06eb6cc5a5 (diff)
Merge branch 'tunnels'
Nicolas Dichtel says: ==================== tunnels: don't allow to add the same tunnel twice This series fixes the check of an existing tunnel with the same parameters when a new tunnel is added. I've checked all users of ip_tunnel_newlink(): gre, gretap, ipip and vti. The bug exists only for gre and vti. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/ip_gre.c2
-rw-r--r--net/ipv4/ip_vti.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index ec4f762efda5..94213c891565 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -463,6 +463,7 @@ static const struct net_device_ops ipgre_netdev_ops = {
463static void ipgre_tunnel_setup(struct net_device *dev) 463static void ipgre_tunnel_setup(struct net_device *dev)
464{ 464{
465 dev->netdev_ops = &ipgre_netdev_ops; 465 dev->netdev_ops = &ipgre_netdev_ops;
466 dev->type = ARPHRD_IPGRE;
466 ip_tunnel_setup(dev, ipgre_net_id); 467 ip_tunnel_setup(dev, ipgre_net_id);
467} 468}
468 469
@@ -501,7 +502,6 @@ static int ipgre_tunnel_init(struct net_device *dev)
501 memcpy(dev->dev_addr, &iph->saddr, 4); 502 memcpy(dev->dev_addr, &iph->saddr, 4);
502 memcpy(dev->broadcast, &iph->daddr, 4); 503 memcpy(dev->broadcast, &iph->daddr, 4);
503 504
504 dev->type = ARPHRD_IPGRE;
505 dev->flags = IFF_NOARP; 505 dev->flags = IFF_NOARP;
506 dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; 506 dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
507 dev->addr_len = 4; 507 dev->addr_len = 4;
diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c
index 687ddef4e574..afcee51b90ed 100644
--- a/net/ipv4/ip_vti.c
+++ b/net/ipv4/ip_vti.c
@@ -337,6 +337,7 @@ static const struct net_device_ops vti_netdev_ops = {
337static void vti_tunnel_setup(struct net_device *dev) 337static void vti_tunnel_setup(struct net_device *dev)
338{ 338{
339 dev->netdev_ops = &vti_netdev_ops; 339 dev->netdev_ops = &vti_netdev_ops;
340 dev->type = ARPHRD_TUNNEL;
340 ip_tunnel_setup(dev, vti_net_id); 341 ip_tunnel_setup(dev, vti_net_id);
341} 342}
342 343
@@ -348,7 +349,6 @@ static int vti_tunnel_init(struct net_device *dev)
348 memcpy(dev->dev_addr, &iph->saddr, 4); 349 memcpy(dev->dev_addr, &iph->saddr, 4);
349 memcpy(dev->broadcast, &iph->daddr, 4); 350 memcpy(dev->broadcast, &iph->daddr, 4);
350 351
351 dev->type = ARPHRD_TUNNEL;
352 dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr); 352 dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr);
353 dev->mtu = ETH_DATA_LEN; 353 dev->mtu = ETH_DATA_LEN;
354 dev->flags = IFF_NOARP; 354 dev->flags = IFF_NOARP;