]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - net/ipv6/ip6mr.c
ip6mr: only set ip6mr_table from setsockopt when ip6mr_new_table succeeds
authorSabrina Dubroca <sd@queasysnail.net>
Tue, 5 Jun 2018 13:01:59 +0000 (15:01 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 5 Sep 2018 08:30:45 +0000 (10:30 +0200)
commit4861f799bfbb512f9f8be9c04eb6d799f98a4215
treeadec2fcbe8730a907e9e7a227be391b24918f492
parent660de1dff97e7589e60f10b15a295605f8bc0a6f
ip6mr: only set ip6mr_table from setsockopt when ip6mr_new_table succeeds

BugLink: http://bugs.launchpad.net/bugs/1789666
[ Upstream commit 848235edb5c93ed086700584c8ff64f6d7fc778d ]

Currently, raw6_sk(sk)->ip6mr_table is set unconditionally during
ip6_mroute_setsockopt(MRT6_TABLE). A subsequent attempt at the same
setsockopt will fail with -ENOENT, since we haven't actually created
that table.

A similar fix for ipv4 was included in commit 5e1859fbcc3c ("ipv4: ipmr:
various fixes and cleanups").

Fixes: d1db275dd3f6 ("ipv6: ip6mr: support multiple tables")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
net/ipv6/ip6mr.c