]> git.ipfire.org Git - people/ms/dnsmasq.git/commitdiff
Don't reply to DHCPCONFIRM messages with no addresses in them.
authorIlya Ponetaev <iponetaev@dlink.ru>
Sat, 13 Sep 2014 20:11:16 +0000 (21:11 +0100)
committerSimon Kelley <simon@thekelleys.org.uk>
Sat, 13 Sep 2014 20:11:16 +0000 (21:11 +0100)
src/rfc3315.c

index 3728c291f717ad73b6c41b1627204cf12a200469..f5ab4f7fdd38e8db3ba47a2ac24fc2704aa9e24e 100644 (file)
@@ -1040,6 +1040,8 @@ static int dhcp6_no_relay(struct state *state, int msg_type, void *inbuff, size_
       
     case DHCP6CONFIRM:
       {
+       int good_addr = 0;
+
        /* set reply message type */
        *outmsgtypep = DHCP6REPLY;
        
@@ -1064,9 +1066,14 @@ static int dhcp6_no_relay(struct state *state, int msg_type, void *inbuff, size_
                    return 1;
                  }
 
+               good_addr = 1;
                log6_quiet(state, "DHCPREPLY", req_addr, state->hostname);
              }
          }      
+       
+       /* No addresses, no reply: RFC 3315 18.2.2 */
+       if (!good_addr)
+         return 0;
 
        o1 = new_opt6(OPTION6_STATUS_CODE);
        put_opt6_short(DHCP6SUCCESS );