Subject: Re: [PATCH] IPIP: Allow rebinding the tunnel to another interface

From: Patrick McHardy <[email-masked]>
Date: Wed, 12 Dec 2007 17:00:14 +0100

Michal Schmidt wrote:
> +static void ipip_tunnel_bind_dev(struct net_device *dev)
> +{
...
> +	dev->iflink = tunnel->parms.link;
> +}
> +
>  static int
>  ipip_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
>  {
> @@ -723,6 +757,10 @@ ipip_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
>  				t->parms.iph.ttl = p.iph.ttl;
>  				t->parms.iph.tos = p.iph.tos;
>  				t->parms.iph.frag_off = p.iph.frag_off;
> +				if (t->parms.link != p.link) {
> +					t->parms.link = p.link;
> +					ipip_tunnel_bind_dev(dev);
> +				}

If you change dev->iflink this should trigger a rtnetlink
notification.