]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Server no longer complains about NULL pointer when configured
authorTomek Mrugalski <tomek@isc.org>
Mon, 23 May 2011 10:34:10 +0000 (10:34 +0000)
committerTomek Mrugalski <tomek@isc.org>
Mon, 23 May 2011 10:34:10 +0000 (10:34 +0000)
server-identifier expression fails to evaluate. [ISC-Bugs #24547]

RELNOTES
server/dhcp.c

index 70206505d86e17bb6f8fc84d214724698499e8d5..b215ccd90b1b33c0f7a87f9cc6e0f8064cb5dac1 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -159,6 +159,9 @@ work on other platforms. Please report any problems and suggested fixes to
 - Documentation cleanup
   [ISC-Bugs #23326] Updated References document, several man page updates
 
+- Server no longer complains about NULL pointer when configured 
+  server-identifier expression fails to evaluate. [ISC-Bugs #24547]
+
                        Changes since 4.2.0
 
 - Documentation cleanup covering multiple tickets
index 3df279f0dc6ae106f521d87c6f97ab02327205b7..126b8fc4c58d9c15ffdea9540498bc626d441cd4 100644 (file)
@@ -4395,15 +4395,18 @@ get_server_source_address(struct in_addr *from,
 
                option_num = DHO_DHCP_SERVER_IDENTIFIER;
                oc = lookup_option(&dhcp_universe, options, option_num);
-               if ((oc != NULL) &&
-           evaluate_option_cache(&d, packet, NULL, NULL, packet->options,
-                                 options, &global_scope, oc, MDL)) {
-               if (d.len == sizeof(*from)) {
-                       memcpy(from, d.data, sizeof(*from));
+               if (oc != NULL)  {
+               if (evaluate_option_cache(&d, packet, NULL, NULL, 
+                                         packet->options, options, 
+                                         &global_scope, oc, MDL)) {
+                       if (d.len == sizeof(*from)) {
+                               memcpy(from, d.data, sizeof(*from));
+                               data_string_forget(&d, MDL);
+                               return;
+                       }
                        data_string_forget(&d, MDL);
-                       return;
                }
-               data_string_forget(&d, MDL);
+               oc = NULL;
        }
 
        if (packet->interface->address_count > 0) {