Bug 730627

Summary: can't change hoplimit of tunnel device in ip6ip6 mode
Product: Red Hat Enterprise Linux 6 Reporter: Dayong Tian <dtian>
Component: iprouteAssignee: Petr Šabata <psabata>
Status: CLOSED ERRATA QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: low Docs Contact:
Priority: medium    
Version: 6.2CC: dspurek, jbenc
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: iproute-2.6.32-18.el6 Doc Type: Bug Fix
Doc Text:
Cause The ip6tunnel mode passed a zeroed parameter structure to kernel which attempted to change all tunnel parameters to zero and failed. Consequence Users couldn't change ip6tunnel parameters. Fix The ip6tunnel code was changed so it updates only the changed parameters, like iptunnel does. Result It is now possible for users to adjust ip6tunnel parameters.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 13:43:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Jiri's patch tweaked for EL6 none

Description Dayong Tian 2011-08-15 07:22:40 UTC
Description of problem:
can't change hoplimit(TTL) of tunnel device in ip6ip6 mode

Version-Release number of selected component (if applicable):
2.6.32-188.el6

How reproducible:
always

Steps to Reproduce:
1. create ip6ip6 tunnel device:
   ip -6 tunnel add tunl6 mode ip6ip6 remote $REMOTE_IP local $LOCAL_IP
   ifconfig tunl6 up
   ip addr add $TUNL_IP dev tunl6

[root@dell-pe1855-01 ~]# ifconfig tunl6
tunl6     Link encap:UNSPEC  HWaddr 20-01-0D-B8-AC-10-FE-01-00-00-00-00-00-00-00-00  
          inet6 addr: 3001:db8:ac10:fe01::2/64 Scope:Global
          inet6 addr: fe80::212:3fff:fe68:1430/64 Scope:Link
          UP POINTOPOINT RUNNING NOARP  MTU:1600  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:104 (104.0 b)  TX bytes:480 (480.0 b)

[root@dell-pe1855-01 ~]# ip -6 tun show
ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit 0 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)
tunl6: ipv6/ipv6 remote 2001:db8:ac10:fe01::3 local 2001:db8:ac10:fe01::2 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)

2. change the hoplimit of the tunnel device
   ip -6 tun change tunl6 hoplimit 32
  
Actual results:
can't change the hoplimit value:
[root@dell-pe1855-01 ~]# ip -6 tun change tunl6 hoplimit 32
ioctl: File exists

Expected results:


Additional info:
[root@dell-pe1855-01 ~]# strace -f -v ip -6 tun change tunl6 hoplimit 32
execve("/sbin/ip", ["ip", "-6", "tun", "change", "tunl6", "hoplimit", "32"], ["LAB_CONTROLLER=lab2.rhts.eng.bos"..., "HOSTNAME=dell-pe1855-01.rhts.eng"..., "SELINUX_ROLE_REQUESTED=", "TERM=xterm", "SHELL=/bin/bash", "HISTSIZE=1000", "SSH_CLIENT=10.66.12.103 60325 22", "SELINUX_USE_CURRENT_RANGE=", "BUILDURL=http://download.eng.bos"..., "DUMPSERVER=netdump-01.eng.bos.re"..., "QTDIR=/usr/lib64/qt-3.3", "QTINC=/usr/lib64/qt-3.3/include", "SSH_TTY=/dev/pts/0", "USER=root", "LS_COLORS=rs=0:di=01;34:ln=01;36"..., "COBBLER_SERVER=lab2.rhts.eng.bos"..., "MAIL=/var/spool/mail/root", "PATH=/usr/lib64/qt-3.3/bin:/usr/"..., "PWD=/root", "XMODIFIERS=@im=ibus", "LANG=en_US.UTF-8", "LOOKASIDE=http://download.eng.bo"..., "SELINUX_LEVEL_REQUESTED=", "HISTCONTROL=ignoredups", "SHLVL=1", "HOME=/root", "LANGUAGE=", "NFSSERVERS=RHEL3,rhel3-nfs.rhts."..., "LOGNAME=root", "QTLIB=/usr/lib64/qt-3.3/lib", "CVS_RSH=ssh", "SSH_CONNECTION=10.66.12.103 6032"..., "LESSOPEN=|/usr/bin/lesspipe.sh %"..., "G_BROKEN_FILENAMES=1", "_=/usr/bin/strace", "OLDPWD=/root/tun"]) = 0
brk(0)                                  = 0x1dee000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7bc0187000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_dev=makedev(253, 0), st_ino=132479, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=88, st_size=44202, st_atime=2011/08/14-20:52:54, st_mtime=2011/08/14-20:50:58, st_ctime=2011/08/14-20:50:58}) = 0
mmap(NULL, 44202, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7bc017c000
close(3)                                = 0
open("/lib64/libresolv.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3008\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_dev=makedev(253, 0), st_ino=1966120, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=224, st_size=110904, st_atime=2011/08/14-20:36:06, st_mtime=2011/04/05-04:33:52, st_ctime=2011/08/14-20:36:02}) = 0
mmap(NULL, 2202248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f7bbfd4f000
mprotect(0x7f7bbfd65000, 2097152, PROT_NONE) = 0
mmap(0x7f7bbff65000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7f7bbff65000
mmap(0x7f7bbff67000, 6792, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f7bbff67000
close(3)                                = 0
open("/lib64/libdl.so.2", O_RDONLY)     = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\r\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_dev=makedev(253, 0), st_ino=1966100, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=40, st_size=19536, st_atime=2011/08/14-20:36:06, st_mtime=2011/04/05-04:33:52, st_ctime=2011/08/14-20:36:02}) = 0
mmap(NULL, 2109696, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f7bbfb4b000
mprotect(0x7f7bbfb4d000, 2097152, PROT_NONE) = 0
mmap(0x7f7bbfd4d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f7bbfd4d000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY)      = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\355\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_dev=makedev(253, 0), st_ino=1966094, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=3728, st_size=1907344, st_atime=2011/08/14-20:36:06, st_mtime=2011/04/05-04:33:54, st_ctime=2011/08/14-20:36:01}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7bc017b000
mmap(NULL, 3737768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f7bbf7ba000
mprotect(0x7f7bbf941000, 2097152, PROT_NONE) = 0
mmap(0x7f7bbfb41000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x187000) = 0x7f7bbfb41000
mmap(0x7f7bbfb46000, 18600, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f7bbfb46000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7bc017a000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7bc0179000
arch_prctl(ARCH_SET_FS, 0x7f7bc017a700) = 0
mprotect(0x7f7bbfb41000, 16384, PROT_READ) = 0
mprotect(0x7f7bbfd4d000, 4096, PROT_READ) = 0
mprotect(0x7f7bbff65000, 4096, PROT_READ) = 0
mprotect(0x7f7bc0188000, 4096, PROT_READ) = 0
munmap(0x7f7bc017c000, 44202)           = 0
socket(PF_NETLINK, SOCK_RAW, 0)         = 3
setsockopt(3, SOL_SOCKET, SO_SNDBUF, [32768], 4) = 0
setsockopt(3, SOL_SOCKET, SO_RCVBUF, [1048576], 4) = 0
bind(3, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
getsockname(3, {sa_family=AF_NETLINK, pid=3329, groups=00000000}, [12]) = 0
socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = 4
ioctl(4, 0x89f3, 0x7fff1e4bf180)        = -1 EEXIST (File exists)
dup(2)                                  = 5
fcntl(5, F_GETFL)                       = 0x8002 (flags O_RDWR|O_LARGEFILE)
brk(0)                                  = 0x1dee000
brk(0x1e0f000)                          = 0x1e0f000
fstat(5, {st_dev=makedev(0, 11), st_ino=3, st_mode=S_IFCHR|0620, st_nlink=1, st_uid=0, st_gid=5, st_blksize=1024, st_blocks=0, st_rdev=makedev(136, 0), st_atime=2011/08/15-03:15:33, st_mtime=2011/08/15-03:15:33, st_ctime=2011/08/15-02:50:04}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7bc0186000
lseek(5, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
write(5, "ioctl: File exists\n", 19ioctl: File exists
)    = 19
close(5)                                = 0
munmap(0x7f7bc0186000, 4096)            = 0
close(4)                                = 0
exit_group(-1)                          = ?

Comment 2 Jiri Benc 2011-09-15 16:23:51 UTC
The code for changing ip6tunnel parameters in iproute2 is incorrect, even in the newest upstream iproute2 git (as far as I can tell; git.kernel.org is still down). Unchanged parameters should be initialized to the current values, but they are set to zero instead. Will make a patch.

Comment 4 Petr Šabata 2011-10-11 10:43:21 UTC
Thank you, Jiri.

Requesting acks.

Comment 5 Petr Šabata 2011-10-11 10:48:38 UTC
Created attachment 527410 [details]
Jiri's patch tweaked for EL6

Comment 8 Petr Šabata 2012-01-04 15:22:21 UTC
Tagged as iproute-2_6_32-18_el6

Comment 10 Petr Šabata 2012-03-14 15:47:07 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
    The ip6tunnel mode passed a zeroed parameter structure to kernel which attempted to change all tunnel parameters to zero and failed.
Consequence
    Users couldn't change ip6tunnel parameters.
Fix
    The ip6tunnel code was changed so it updates only the changed parameters, like iptunnel does.
Result
    It is now possible for users to adjust ip6tunnel parameters.

Comment 13 errata-xmlrpc 2012-06-20 13:43:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0835.html