Bug 419671 - ip tunnel can't be bound to another device
ip tunnel can't be bound to another device
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Michal Schmidt
Fedora Extras Quality Assurance
Depends On:
Blocks: 437410
  Show dependency treegraph
Reported: 2007-12-11 07:48 EST by Marcela Mašláňová
Modified: 2008-03-13 17:48 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-12-14 07:18:32 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
allow rebinding of ipip tunnels (2.69 KB, patch)
2007-12-12 09:45 EST, Michal Schmidt
no flags Details | Diff

  None (edit)
Description Marcela Mašláňová 2007-12-11 07:48:58 EST
Description of problem:
ip tunnel can't be bound to another device

Version-Release number of selected component (if applicable):
kernel- with latest iproute-2.6.22

How reproducible:

Steps to Reproduce:
1. create tunnel
# ip tunnel add tunneltest0 mode ipip remote dev eth0
2. try to change the bounding device from eth0 to eth1
# ip tunnel change tunneltest0 dev eth1
3. show the result
# ip tunnel show tunneltest0
# tunneltest0: ip/ip  remote  local any  dev eth0  ttl inherit

Actual results:
The tunnel bounding can't be change on the other device.

Expected results:
The tunnel bounding can be change on the other device.
Comment 1 Tomas Janousek 2007-12-11 08:05:10 EST
Our short investigation showed that the SIOCCHGTUNNEL case in
net/ipv6/sit.c:ipip6_tunnel_ioctl does not care about the p->link at all. And
it's probably the same for ipip and gre.
Comment 2 Michal Schmidt 2007-12-12 09:44:40 EST
I took a look at net/ipv4/ipip.c (this one is relevant for the provided
testcase). Tomas, you're right that the handler for SIOCCHGTUNNEL ioctl ignores
p.link completely.

I have a patch to allow re-binding the tunnel to another device. It also
recalculates the MTU of the tunnel from the known MTU of the newly bound device.
I believe it's the right thing to do in this case. I'll send the patch to netdev
and if it's accepted, I'll make similar changes to gre and sit.

(Assigning the bug to myself.)
Comment 3 Michal Schmidt 2007-12-12 09:45:35 EST
Created attachment 285761 [details]
allow rebinding of ipip tunnels
Comment 4 Michal Schmidt 2007-12-14 07:18:32 EST
The patch was sent to netdev (http://www.spinics.net/lists/netdev/msg49844.html). 
It was accepted with a small modification.

I submitted similar patches for GRE and SIT

Dave Miller applied all three patches to his git tree. They will be in Linux 2.6.25.
Comment 5 Tomas Janousek 2007-12-14 16:00:04 EST
Thanks, Michal.
If I'm not mistaken, no further modification to iproute should be needed.
Comment 6 Michal Schmidt 2007-12-14 17:46:47 EST
correct, no change is needed in iproute.

Note You need to log in before you can comment on or make changes to this bug.