diff options
author | Kaspar Schleiser <kaspar@schleiser.de> | 2014-01-09 15:58:31 +0100 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2014-01-27 14:16:44 +0100 |
commit | bbcc9cfa44372f58cb33d556d9b7c57f6ee96b61 (patch) | |
tree | ad7945050efa42e3f400cce5e4a7f8d0643bf320 /src/odhcp6c.c | |
parent | 62ea2821e389332d13cc05eb1ac6e77a7787f2db (diff) | |
download | odhcp6c-bbcc9cfa44372f58cb33d556d9b7c57f6ee96b61.tar.gz |
added command line switch for strict oro
Now "-R" command line switch makes odhcpv6c only request those options
specified by "-r".
Contributed by T-Labs, Deutsche Telekom Innovation Laboratories
Diffstat (limited to 'src/odhcp6c.c')
-rw-r--r-- | src/odhcp6c.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/odhcp6c.c b/src/odhcp6c.c index 2159363..e5e415c 100644 --- a/src/odhcp6c.c +++ b/src/odhcp6c.c @@ -71,10 +71,10 @@ int main(_unused int argc, char* const argv[]) int bfd_interval = 0, bfd_loss = 3; #endif - bool help = false, daemonize = false; + bool help = false, daemonize = false, strict_options = false; int logopt = LOG_PID; int c, request_pd = 0; - while ((c = getopt(argc, argv, "S::N:P:FB:c:i:r:s:kt:hedp:")) != -1) { + while ((c = getopt(argc, argv, "S::N:P:FB:c:i:r:Rs:kt:hedp:")) != -1) { switch (c) { case 'S': allow_slaac_only = (optarg) ? atoi(optarg) : -1; @@ -144,6 +144,10 @@ int main(_unused int argc, char* const argv[]) } break; + case 'R': + strict_options = true; + break; + case 's': script = optarg; break; @@ -189,7 +193,7 @@ int main(_unused int argc, char* const argv[]) signal(SIGUSR2, sighandler); if ((urandom_fd = open("/dev/urandom", O_CLOEXEC | O_RDONLY)) < 0 || - init_dhcpv6(ifname, request_pd, sol_timeout) || + init_dhcpv6(ifname, request_pd, strict_options, sol_timeout) || ra_init(ifname, &ifid) || script_init(script, ifname)) { syslog(LOG_ERR, "failed to initialize: %s", strerror(errno)); return 3; @@ -391,6 +395,7 @@ static int usage(void) " -c <clientid> Override client-ID (base-16 encoded)\n" " -i <iface-id> Use a custom interface identifier for RA handling\n" " -r <options> Options to be requested (comma-separated)\n" + " -R Do not request any options except those specified with -r\n" " -s <script> Status update script (/usr/sbin/odhcp6c-update)\n" " -k Don't send a RELEASE when stopping\n" " -t <seconds> Maximum timeout for DHCPv6-SOLICIT (120)\n" |