]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ip_vti: Fix 'ip tunnel add' with 'key' parameters
authorDmitry Popov <ixaphire@qrator.net>
Sat, 7 Jun 2014 22:06:25 +0000 (02:06 +0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Jun 2014 07:30:52 +0000 (00:30 -0700)
commit7c8e6b9c2811fd37702a9043eabea3545022011e
tree3db0b14dd5d349ecbc21de5b20d2205081f3f5c2
parent84a7c0b1db1c17d5ded8d3800228a608e1070b40
ip_vti: Fix 'ip tunnel add' with 'key' parameters

ip tunnel add remote 10.2.2.1 local 10.2.2.2 mode vti ikey 1 okey 2
translates to p->iflags = VTI_ISVTI|GRE_KEY and p->i_key = 1, but GRE_KEY !=
TUNNEL_KEY, so ip_tunnel_ioctl would set i_key to 0 (same story with o_key)
making us unable to create vti tunnels with [io]key via ip tunnel.

We cannot simply translate GRE_KEY to TUNNEL_KEY (as GRE module does) because
vti_tunnels with same local/remote addresses but different ikeys will be treated
as different then. So, imo the best option here is to move p->i_flags & *_KEY
check for vti tunnels from ip_tunnel.c to ip_vti.c and to think about [io]_mark
field for ip_tunnel_parm in the future.

Signed-off-by: Dmitry Popov <ixaphire@qrator.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_tunnel.c
net/ipv4/ip_vti.c