From 671c54b1876b2b46a37cc587a114a2b5cf9ed2d0 Mon Sep 17 00:00:00 2001 From: Telire Barry Date: Wed, 22 Jun 2022 16:55:48 +0200 Subject: ipv6_nd: fix ipv6 auto-configuration in netns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ipv6 auto-configuration generate error when link is terminated inside netns. The error message is : "ipv6_nd: setsockopt(SO_BINDTODEVICE): No such device" This error is generated because socket is not created inside the netns but it’s created in the default netns. This fix allow to create the socket in the right place. to propose this fix, i was inspired by : issue : https://phabricator.accel-ppp.org/T68 commit : https://github.com/accel-ppp/accel-ppp/commit/f1d616d91914be493b6a32a96323fa871733f8e0 --- accel-pppd/ipv6/nd.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'accel-pppd/ipv6/nd.c') diff --git a/accel-pppd/ipv6/nd.c b/accel-pppd/ipv6/nd.c index 943ed6d3..297e4d63 100644 --- a/accel-pppd/ipv6/nd.c +++ b/accel-pppd/ipv6/nd.c @@ -284,7 +284,9 @@ static int ipv6_nd_start(struct ap_session *ses) int val; struct ipv6_nd_handler_t *h; + net->enter_ns(); sock = net->socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6); + net->exit_ns(); if (sock < 0) { log_ppp_error("socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6): %s\n", strerror(errno)); -- cgit v1.2.3