]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[master] dhclient -6 now supports option expressions such as prepend
authorThomas Markwalder <tmark@isc.org>
Mon, 18 Jan 2016 13:46:17 +0000 (08:46 -0500)
committerThomas Markwalder <tmark@isc.org>
Mon, 18 Jan 2016 13:46:17 +0000 (08:46 -0500)
    Merges in rt39952.

RELNOTES
client/dhc6.c

index b63312259080b8af580654662e200f2c3d23a8f1..65adecfe3e73f5ee1d8bb5820f88811b301a0b2f 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -150,6 +150,12 @@ by Eric Young (eay@cryptsoft.com).
   Thanks to Andrey Jr. Melnikov for the bug report.
   [ISC-Bugs #41217]
 
+- Option expressions, such as prepend and append, are now supported when
+  running dhclient for IPv6.  Prior to this such statements in the
+  client configuration file would be parsed but have no affect.  Thanks
+  to Jiri Popelka at Red Hat for reporting the issue.
+  [ISC-Bugs #39952]
+
                        Changes since 4.3.3b1
 - None
 
index b3a7d5c2154a950e0fbc228aa4d00aea8a696388..aacd4aea604e7980ac497ff086179c8700f3e34a 100644 (file)
@@ -1,7 +1,7 @@
 /* dhc6.c - DHCPv6 client routines. */
 
 /*
- * Copyright (c) 2012-2015 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2012-2016 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 2006-2010 by Internet Systems Consortium, Inc. ("ISC")
  *
  * Permission to use, copy, modify, and distribute this software for any
@@ -572,7 +572,7 @@ dhc6_dup_addr(struct dhc6_addr *addr, const char *file, int line)
  *
  */
 static struct dhc6_lease *
-dhc6_leaseify(struct packet *packet)
+dhc6_leaseify(struct packet *packet, struct client_state* client)
 {
        struct data_string ds;
        struct dhc6_lease *lease;
@@ -681,6 +681,11 @@ dhc6_leaseify(struct packet *packet)
                                      lease->server_id.data, 52));
        }
 
+       execute_statements_in_scope(NULL, (struct packet *)packet, NULL,
+                                   client, lease->options, lease->options,
+                                   &global_scope, client->config->on_receipt,
+                                   NULL, NULL);
+
        return lease;
 }
 
@@ -3114,7 +3119,7 @@ init_handler(struct packet *packet, struct client_state *client)
                return;
        }
 
-       lease = dhc6_leaseify(packet);
+       lease = dhc6_leaseify(packet, client);
 
        /* Out of memory or corrupt packet condition...hopefully a temporary
         * problem.  Returning now makes us try to retransmit later.
@@ -3204,6 +3209,12 @@ info_request_handler(struct packet *packet, struct client_state *client)
        option_state_reference(&client->active_lease->options,
                               packet->options, MDL);
 
+       execute_statements_in_scope(NULL, (struct packet *)packet, NULL, client,
+                                   client->active_lease->options,
+                                   client->active_lease->options,
+                                   &global_scope, client->config->on_receipt,
+                                   NULL, NULL);
+
        start_informed(client);
 }
 
@@ -3238,7 +3249,7 @@ rapid_commit_handler(struct packet *packet, struct client_state *client)
                return;
        }
 
-       lease = dhc6_leaseify(packet);
+       lease = dhc6_leaseify(packet, client);
 
        /* Out of memory or corrupt packet condition...hopefully a temporary
         * problem.  Returning now makes us try to retransmit later.
@@ -4179,7 +4190,7 @@ reply_handler(struct packet *packet, struct client_state *client)
                return;
        }
 
-       lease = dhc6_leaseify(packet);
+       lease = dhc6_leaseify(packet, client);
 
        /* Out of memory or corrupt packet condition...hopefully a temporary
         * problem.  Returning now makes us try to retransmit later.