Index: client/dhclient.c =================================================================== --- client/dhclient.c.orig +++ client/dhclient.c @@ -284,6 +284,18 @@ main(int argc, char **argv) { #else 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)); Index: relay/dhcrelay.c =================================================================== --- relay/dhcrelay.c.orig +++ relay/dhcrelay.c @@ -300,6 +300,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. */ Index: server/dhcpd.c =================================================================== --- server/dhcpd.c.orig +++ server/dhcpd.c @@ -301,6 +301,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. */