]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Jun 2018 16:26:39 +0000 (12:26 -0400)
commit73cbeb5692f508073041342db00c25c1edfd54b4
treead8211588a1867fe378e81e300aff1aae796f3a2
parentc5e46948f7642c6d3de8a2645373d61b156a0e5e
ip6mr: only set ip6mr_table from setsockopt when ip6mr_new_table succeeds

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 1a70c6258fb8 ("ipv4: ipmr:
various fixes and cleanups").

Fixes: fa4a490165bd ("ipv6: ip6mr: support multiple tables")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6mr.c