Merge pull request #274 from initramfs/equuleus-dhcp6c-fix

backport: wide-dhcpv6: T4760: fix support for multiple dhcp6c instances
This commit is contained in:
Daniil Baturin 2023-12-21 16:10:00 +00:00 committed by GitHub
commit 8073d93558
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,17 @@
diff --git a/dhcp6c.c b/dhcp6c.c
index 1caaaa5..04ce9c5 100644
--- a/dhcp6c.c
+++ b/dhcp6c.c
@@ -217,6 +217,12 @@ main(argc, argv)
argv[0]);
exit(1);
}
+
+ if (setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, argv[0], strlen(argv[0])) != 0) {
+ debug_printf(LOG_ERR, FNAME, "failed to bind %s", argv[0]);
+ exit(1);
+ }
+
argv++;
}