]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Add an option to enable DHCPv6 Information Request without the need
authorRoy Marples <roy@marples.name>
Wed, 30 Sep 2015 09:02:13 +0000 (09:02 +0000)
committerRoy Marples <roy@marples.name>
Wed, 30 Sep 2015 09:02:13 +0000 (09:02 +0000)
for dhcpcd to recieve an IPv6 Router Advertisement with the Other
Configuration bit set.

dhcpcd.8.in
dhcpcd.c
if-options.c
if-options.h

index 8157e6942e9c61d3875034d7009b7652bcf1bfb3..67e0035be128d2c99037559b1d2942f1fafc5a34 100644 (file)
@@ -48,6 +48,7 @@
 .Op Fl r , Fl Fl request Ar address
 .Op Fl S , Fl Fl static Ar value
 .Op Fl s , Fl Fl inform Ar address Ns Op Ar /cidr
+.Op Fl Fl inform6
 .Op Fl t , Fl Fl timeout Ar seconds
 .Op Fl u , Fl Fl userclass Ar class
 .Op Fl v , Fl Fl vendor Ar code , Ar value
@@ -419,6 +420,15 @@ If
 .Nm
 fails to contact a DHCP server then it returns a failure instead of falling
 back on IPv4LL.
+.It Fl Fl inform6
+Performs a DHCPv6 Information Request.
+No address is requested or specified, but all other DHCPv6 options are allowed.
+This is normally performed automatically when the IPv6 Router Advertises
+that the client should perform this operation.
+This option is only needed when
+.Nm
+is not processing IPv6RA messages and the need for DHCPv6 Information Request
+exists.
 .It Fl S, Fl Fl static Ar value
 Configures a static DHCP
 .Ar value .
index 6fa04dbbd0e60f0678c8f538f8a2e32a5f7ecb07..7921ca19af2ccd856beb14b77450ce2838e4e23a 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -852,20 +852,21 @@ dhcpcd_startinterface(void *arg)
        }
 
        if (ifo->options & DHCPCD_IPV6) {
-               if (ifo->options & DHCPCD_IPV6RS &&
-                   !(ifo->options & DHCPCD_INFORM))
+               if (ifo->options & DHCPCD_IPV6RS)
                        ipv6nd_startrs(ifp);
 
                if (ifo->options & DHCPCD_DHCP6)
                        dhcp6_find_delegates(ifp);
 
                if (!(ifo->options & DHCPCD_IPV6RS) ||
-                   ifo->options & DHCPCD_IA_FORCED)
+                   ifo->options & (DHCPCD_IA_FORCED | DHCPCD_INFORM6))
                {
                        ssize_t nolease;
 
                        if (ifo->options & DHCPCD_IA_FORCED)
                                nolease = dhcp6_start(ifp, DH6S_INIT);
+                       else if (ifo->options & DHCPCD_INFORM6)
+                               nolease = dhcp6_start(ifp, DH6S_INFORM);
                        else {
                                nolease = 0;
                                /* Enabling the below doesn't really make
index c03f7d3fe9c551ac99abc8afe2f979a7e7d45e05..40753fc4790b223b51b62dd40262b60d37520137 100644 (file)
 #define O_BOOTP                        O_BASE + 42
 #define O_DEFINEND             O_BASE + 43
 #define O_NODELAY              O_BASE + 44
+#define O_INFORM6              O_BASE + 45
 
 const struct option cf_options[] = {
        {"background",      no_argument,       NULL, 'b'},
@@ -122,6 +123,7 @@ const struct option cf_options[] = {
        {"quiet",           no_argument,       NULL, 'q'},
        {"request",         optional_argument, NULL, 'r'},
        {"inform",          optional_argument, NULL, 's'},
+       {"inform6",         optional_argument, NULL, O_INFORM6},
        {"timeout",         required_argument, NULL, 't'},
        {"userclass",       required_argument, NULL, 'u'},
        {"vendor",          required_argument, NULL, 'v'},
@@ -795,12 +797,6 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
                ifo->req_mask.s_addr = 0;
                break;
        case 's':
-               if (ifo->options & DHCPCD_IPV6 &&
-                   !(ifo->options & DHCPCD_IPV4))
-               {
-                       ifo->options |= DHCPCD_INFORM;
-                       break;
-               }
                if (arg && *arg != '\0') {
                        if (parse_addr(ctx,
                            &ifo->req_addr, &ifo->req_mask, arg) != 0)
@@ -812,6 +808,9 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
                ifo->options |= DHCPCD_INFORM | DHCPCD_PERSISTENT;
                ifo->options &= ~DHCPCD_STATIC;
                break;
+       case O_INFORM6:
+               ifo->options |= DHCPCD_INFORM6;
+               break;
        case 't':
                ifo->timeout = (time_t)strtoi(arg, NULL, 0, 0, INT32_MAX, &e);
                if (e) {
index 984496f95a6b53a232db22583986cb33f06ed971..cf1d4a352e3e426400585cac6c6aa0aa96b7426c 100644 (file)
 #define DHCPCD_DHCP                    (1ULL << 49)
 #define DHCPCD_DHCP6                   (1ULL << 50)
 #define DHCPCD_IF_UP                   (1ULL << 51)
-// unassigned                          (1ULL << 52)
+#define DHCPCD_INFORM6                 (1ULL << 52)
 // unassinged                          (1ULL << 53)
 #define DHCPCD_IPV6RA_AUTOCONF         (1ULL << 54)
 #define DHCPCD_ROUTER_HOST_ROUTE_WARNED        (1ULL << 55)