Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eda43ce0 authored by David S. Miller's avatar David S. Miller
Browse files

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 810d8ced 8d89dcdf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -463,6 +463,7 @@ static const struct net_device_ops ipgre_netdev_ops = {
static void ipgre_tunnel_setup(struct net_device *dev)
{
	dev->netdev_ops		= &ipgre_netdev_ops;
	dev->type		= ARPHRD_IPGRE;
	ip_tunnel_setup(dev, ipgre_net_id);
}

@@ -501,7 +502,6 @@ static int ipgre_tunnel_init(struct net_device *dev)
	memcpy(dev->dev_addr, &iph->saddr, 4);
	memcpy(dev->broadcast, &iph->daddr, 4);

	dev->type		= ARPHRD_IPGRE;
	dev->flags		= IFF_NOARP;
	dev->priv_flags		&= ~IFF_XMIT_DST_RELEASE;
	dev->addr_len		= 4;
+1 −1
Original line number Diff line number Diff line
@@ -337,6 +337,7 @@ static const struct net_device_ops vti_netdev_ops = {
static void vti_tunnel_setup(struct net_device *dev)
{
	dev->netdev_ops		= &vti_netdev_ops;
	dev->type		= ARPHRD_TUNNEL;
	ip_tunnel_setup(dev, vti_net_id);
}

@@ -348,7 +349,6 @@ static int vti_tunnel_init(struct net_device *dev)
	memcpy(dev->dev_addr, &iph->saddr, 4);
	memcpy(dev->broadcast, &iph->daddr, 4);

	dev->type		= ARPHRD_TUNNEL;
	dev->hard_header_len	= LL_MAX_HEADER + sizeof(struct iphdr);
	dev->mtu		= ETH_DATA_LEN;
	dev->flags		= IFF_NOARP;