summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorTelire Barry <t.barry@alphalink.fr>2022-06-22 16:55:48 +0200
committerTelire Barry <t.barry@alphalink.fr>2022-06-22 16:55:48 +0200
commit671c54b1876b2b46a37cc587a114a2b5cf9ed2d0 (patch)
tree5afe07c599773179667c5b86c62a3f09321edb93 /accel-pppd
parent1b8711cf75a7c278d99840112bc7a396398e0205 (diff)
downloadaccel-ppp-671c54b1876b2b46a37cc587a114a2b5cf9ed2d0.tar.gz
accel-ppp-671c54b1876b2b46a37cc587a114a2b5cf9ed2d0.zip
ipv6_nd: fix ipv6 auto-configuration in netns
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
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/ipv6/nd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/accel-pppd/ipv6/nd.c b/accel-pppd/ipv6/nd.c
index 943ed6d..297e4d6 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));