提交 eda43ce0 编写于 作者: D David S. Miller

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: NDavid S. Miller <davem@davemloft.net>
...@@ -463,6 +463,7 @@ static const struct net_device_ops ipgre_netdev_ops = { ...@@ -463,6 +463,7 @@ static const struct net_device_ops ipgre_netdev_ops = {
static void ipgre_tunnel_setup(struct net_device *dev) static void ipgre_tunnel_setup(struct net_device *dev)
{ {
dev->netdev_ops = &ipgre_netdev_ops; dev->netdev_ops = &ipgre_netdev_ops;
dev->type = ARPHRD_IPGRE;
ip_tunnel_setup(dev, ipgre_net_id); ip_tunnel_setup(dev, ipgre_net_id);
} }
...@@ -501,7 +502,6 @@ static int ipgre_tunnel_init(struct net_device *dev) ...@@ -501,7 +502,6 @@ static int ipgre_tunnel_init(struct net_device *dev)
memcpy(dev->dev_addr, &iph->saddr, 4); memcpy(dev->dev_addr, &iph->saddr, 4);
memcpy(dev->broadcast, &iph->daddr, 4); memcpy(dev->broadcast, &iph->daddr, 4);
dev->type = ARPHRD_IPGRE;
dev->flags = IFF_NOARP; dev->flags = IFF_NOARP;
dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
dev->addr_len = 4; dev->addr_len = 4;
......
...@@ -337,6 +337,7 @@ static const struct net_device_ops vti_netdev_ops = { ...@@ -337,6 +337,7 @@ static const struct net_device_ops vti_netdev_ops = {
static void vti_tunnel_setup(struct net_device *dev) static void vti_tunnel_setup(struct net_device *dev)
{ {
dev->netdev_ops = &vti_netdev_ops; dev->netdev_ops = &vti_netdev_ops;
dev->type = ARPHRD_TUNNEL;
ip_tunnel_setup(dev, vti_net_id); ip_tunnel_setup(dev, vti_net_id);
} }
...@@ -348,7 +349,6 @@ static int vti_tunnel_init(struct net_device *dev) ...@@ -348,7 +349,6 @@ static int vti_tunnel_init(struct net_device *dev)
memcpy(dev->dev_addr, &iph->saddr, 4); memcpy(dev->dev_addr, &iph->saddr, 4);
memcpy(dev->broadcast, &iph->daddr, 4); memcpy(dev->broadcast, &iph->daddr, 4);
dev->type = ARPHRD_TUNNEL;
dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr); dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr);
dev->mtu = ETH_DATA_LEN; dev->mtu = ETH_DATA_LEN;
dev->flags = IFF_NOARP; dev->flags = IFF_NOARP;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册