diff options
author | Ilya Ponetaev <iponetaev@dlink.ru> | 2014-09-13 21:11:16 +0100 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2014-09-13 21:11:16 +0100 |
commit | 2d75f2e4a5e099ea629d6a780ad3a6bf7718aaa5 (patch) | |
tree | 5a92f187e21b290b1c006eca5e90a65757584374 | |
parent | 976afc93e477aefd5986a968844cdd996cee1060 (diff) | |
download | dnsmasq-2d75f2e4a5e099ea629d6a780ad3a6bf7718aaa5.tar.gz |
Don't reply to DHCPCONFIRM messages with no addresses in them.
-rw-r--r-- | src/rfc3315.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rfc3315.c b/src/rfc3315.c index 3728c29..f5ab4f7 100644 --- a/src/rfc3315.c +++ b/src/rfc3315.c @@ -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 ); |