SHA256
1
0
forked from pool/dhcp
dhcp/0021-dhcp-ip-family-symlinks.patch
Reinhard Max 2ec1fec7eb - bsc#1134078, CVE-2019-6470, dhcp-CVE-2019-6470.patch:
DHCPv6 server crashes regularly.
- Add compile option --enable-secs-byteorder to avoid duplicate
  lease warnings [bsc#1089524].
- bsc#1136572: Use IPv6 when called as dhclient6, dhcpd6, and
  dhcrelay6 (0021-dhcp-ip-family-symlinks.patch).

OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=201
2019-10-15 15:56:51 +00:00

61 lines
1.8 KiB
Diff

--- client/dhclient.c.orig
+++ client/dhclient.c
@@ -252,6 +252,17 @@ main(int argc, char **argv) {
progname = argv[0];
#endif
+#ifdef DHCPv6
+ /* Support being called using `dhclient4` or `dhclient6` symlinks */
+ if (argv[0][strlen(argv[0]) - 1] == '4') {
+ local_family_set = 1;
+ local_family = AF_INET;
+ } else if (argv[0][strlen(argv[0]) - 1] == '6') {
+ local_family_set = 1;
+ local_family = AF_INET6;
+ }
+#endif /* DHCPv6 */
+
/* Initialize client globals. */
memset(&default_duid, 0, sizeof(default_duid));
--- relay/dhcrelay.c.orig
+++ relay/dhcrelay.c
@@ -237,6 +237,17 @@ main(int argc, char **argv) {
progname = argv[0];
#endif
+#ifdef DHCPv6
+ /* Support being called using `dhcrelay4` or `dhcrelay6` symlinks */
+ if (argv[0][strlen(argv[0]) - 1] == '4') {
+ local_family_set = 1;
+ local_family = AF_INET;
+ } else if (argv[0][strlen(argv[0]) - 1] == '6') {
+ local_family_set = 1;
+ local_family = AF_INET6;
+ }
+#endif /* DHCPv6 */
+
/* Make sure that file descriptors 0(stdin), 1,(stdout), and
2(stderr) are open. To do this, we assume that when we
open a file the lowest available file descriptor is used. */
--- server/dhcpd.c.orig
+++ server/dhcpd.c
@@ -260,6 +260,17 @@ main(int argc, char **argv) {
progname = argv[0];
#endif
+#ifdef DHCPv6
+ /* Support being called using `dhcpd4` or `dhcpd6` symlinks */
+ if (argv[0][strlen(argv[0]) - 1] == '4') {
+ local_family_set = 1;
+ local_family = AF_INET;
+ } else if (argv[0][strlen(argv[0]) - 1] == '6') {
+ local_family_set = 1;
+ local_family = AF_INET6;
+ }
+#endif /* DHCPv6 */
+
/* Make sure that file descriptors 0 (stdin), 1, (stdout), and
2 (stderr) are open. To do this, we assume that when we
open a file the lowest available file descriptor is used. */