Bug 490981 - /sbin/ip assigns too many (and wrong) addresses to IPv6-in-IPv4 tunnel
/sbin/ip assigns too many (and wrong) addresses to IPv6-in-IPv4 tunnel
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Kernel Maintainer List
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-03-18 14:56 EDT by Allen Kistler
Modified: 2009-03-28 17:41 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-03-28 17:41:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Linux Kernel 12868 None None None Never

  None (edit)
Description Allen Kistler 2009-03-18 14:56:41 EDT
Description of problem:
When creating an IPv6-in-IPv4 tunnel, "ip link set $dev up" is not assigning the "local" address from a previous "ip tunnel add" command, but instead is assigning *all* the local IP addresses from existing interfaces, including lo.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. ip tunnel add tun6to4 mode sit remote local
2. ip link set tun6to4 up
3. ifconfig tun6to4
Actual results:
tun6to4   Link encap:IPv6-in-IPv4  
          inet6 addr: :: Scope:Compat
          inet6 addr: :: Scope:Unknown

Expected results:
tun6to4   Link encap:IPv6-in-IPv4  
          inet6 addr: :: Scope:Compat

Additional info:
I discovered the problem attempting to set up a 6to4 tunnel, but I would suspect it would have implications for other cases as well.  The example above uses tun6to4 as the device name, but it could be anything.

To illustrate the point better, I've used an IPv4 address that does *not* correspond to one on a physical device.  If there are two or more physical interfaces, all their IPv4-compatible (deprecated in favor of IPv4-mapped BTW) addresses are assigned, plus the address for lo (::, as the local tunnel endpoint address.

Also note that the netmask has changed from /128 to /96.

My points of comparison for the behavior of /sbin/ip are F9 (iproute-2.6.27-1.fc9.i386) and RHEL5 (iproute-2.6.18-9.el5).
Comment 1 Marcela Mašláňová 2009-03-19 05:08:42 EDT
Ok, I have tested this on rawhide with old kernel kernel- is it working as you expected. With new kernel kernel-2.6.29-0.258.rc8.git2.fc11.x86_64 it's failing.
Comment 2 Marcela Mašláňová 2009-03-19 05:37:09 EDT
After discussion with ifconfig maintainer you should definitely use ip instead of ifconfig ;-) Every new thing in kernel could be incorrectly interpreted by ifconfig. There was some work on tunnels lately, so it could be bug in kernel.

I suppose you should use something like:
ip -4 tunnel show
Comment 3 Allen Kistler 2009-03-19 15:44:40 EDT
Okay.  Using ip instead of ifconfig for the last step ...

1. ip tunnel add tun6to4 mode sit remote local
2. ip link set tun6to4 up
3. ip addr show dev tun6to4

    link/sit brd
    inet6 :: scope global 
    inet6 :: scope host

    link/sit brd
    inet6 :: scope global

F11:  kernel-2.6.29-0.258.rc8.git2.fc11.i586
F9:   kernel-PAE-
RHEL: kernel-2.6.18-128.1.1.el5

Out of curiosity, I also tried kernel-2.6.29-0.66.rc3.fc11.i586 from the "DVD."  It didn't work any better than 258.
Comment 4 Allen Kistler 2009-03-23 20:41:45 EDT
http://bugzilla.kernel.org/show_bug.cgi?id=12868 reports

On Saturday 21 March 2009, Bjørn Mork wrote:
> This is fixed by commit 1b1d8f73a44fe1796a73a97ebcb08cad18b97f07
> currently in davem's net-2.6 tree.

Here's looking forward to a Fedora kernel with it.
Comment 5 Chuck Ebbert 2009-03-24 13:01:27 EDT
That patch was merged before 2.6.29 was released, so this should be fixed in the next kernel build.
Comment 6 Allen Kistler 2009-03-25 20:04:30 EDT
I got impatient and snagged kernel-2.6.29-2.fc11.i586 out of koji.  (I figured the alternative was to wait another week until the beta would be released.)

I can verify that the bug is fixed.  I'll close this report when a kernel with the fix hits rawhide.
Comment 7 Allen Kistler 2009-03-28 17:41:16 EDT
Fixed in rawhide kernel-2.6.29-16.fc11.  Closing.

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