Bug 419671 - ip tunnel can't be bound to another device
Summary: ip tunnel can't be bound to another device
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Michal Schmidt
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 437410
TreeView+ depends on / blocked
 
Reported: 2007-12-11 12:48 UTC by Marcela Mašláňová
Modified: 2008-03-13 21:48 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2007-12-14 12:18:32 UTC
Type: ---
Embargoed:


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

Description Marcela Mašláňová 2007-12-11 12:48:58 UTC
Description of problem:
ip tunnel can't be bound to another device

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

How reproducible:
always

Steps to Reproduce:
1. create tunnel
# ip tunnel add tunneltest0 mode ipip remote 10.0.0.1 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 10.0.0.1  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 13:05:10 UTC
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 14:44:40 UTC
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 14:45:35 UTC
Created attachment 285761 [details]
allow rebinding of ipip tunnels

Comment 4 Michal Schmidt 2007-12-14 12:18:32 UTC
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
(http://www.spinics.net/lists/netdev/msg49983.html).

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 21:00:04 UTC
Thanks, Michal.
If I'm not mistaken, no further modification to iproute should be needed.

Comment 6 Michal Schmidt 2007-12-14 22:46:47 UTC
Tomas,
correct, no change is needed in iproute.


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