diff options
author | Steven Barth <steven@midlink.org> | 2014-02-05 14:47:47 +0100 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2014-02-05 14:47:47 +0100 |
commit | db2915f095db17cb10bf67d5b3bf67f891d45625 (patch) | |
tree | 90a79b0d52fb68dc4f78f20dc1f470f4b15f4e16 /src/odhcp6c.c | |
parent | 6e5aec718c0ee08deed0b213606c927c455965ac (diff) | |
download | odhcp6c-db2915f095db17cb10bf67d5b3bf67f891d45625.tar.gz |
Add user-class option
Diffstat (limited to 'src/odhcp6c.c')
-rw-r--r-- | src/odhcp6c.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/odhcp6c.c b/src/odhcp6c.c index 2668d94..dbe2bdf 100644 --- a/src/odhcp6c.c +++ b/src/odhcp6c.c @@ -61,6 +61,7 @@ int main(_unused int argc, char* const argv[]) uint8_t buf[134]; char *optpos; uint16_t opttype; + uint16_t optlen; enum odhcp6c_ia_mode ia_na_mode = IA_MODE_TRY; enum odhcp6c_ia_mode ia_pd_mode = IA_MODE_NONE; int ia_pd_iaid_index = 0; @@ -76,7 +77,7 @@ int main(_unused int argc, char* const argv[]) int c; unsigned int client_options = DHCPV6_CLIENT_FQDN | DHCPV6_ACCEPT_RECONFIGURE; - while ((c = getopt(argc, argv, "S::N:V:P:FB:c:i:r:Rs:kt:hedp:fa")) != -1) { + while ((c = getopt(argc, argv, "S::N:V:P:FB:c:i:r:Ru:s:kt:hedp:fa")) != -1) { switch (c) { case 'S': allow_slaac_only = (optarg) ? atoi(optarg) : -1; @@ -178,6 +179,12 @@ int main(_unused int argc, char* const argv[]) client_options |= DHCPV6_STRICT_OPTIONS; break; + case 'u': + optlen = htons(strlen(optarg)); + odhcp6c_add_state(STATE_USERCLASS, &optlen, 2); + odhcp6c_add_state(STATE_USERCLASS, optarg, strlen(optarg)); + break; + case 's': script = optarg; break; |