Bug 419671

Summary: ip tunnel can't be bound to another device
Product: [Fedora] Fedora Reporter: Marcela Mašláňová <mmaslano>
Component: kernelAssignee: Michal Schmidt <mschmidt>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: cebbert, davej, kmcmartin, pdwyer, tjanouse
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-12-14 12:18:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 437410    
Attachments:
Description Flags
allow rebinding of ipip tunnels none

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.