diff options
author | Thomas Markwalder <tmark@isc.org> | 2017-09-06 10:25:17 -0400 |
---|---|---|
committer | Thomas Markwalder <tmark@isc.org> | 2017-09-06 10:25:17 -0400 |
commit | d1489a35a9729971dda00df7613b88b19a1fd11c (patch) | |
tree | 7a5d801211b0e7300ed8bf040c4e5d9b6767fc87 /server | |
parent | f883cc903171b43537434d81076a7bb6de7ada62 (diff) | |
download | isc-dhcp-d1489a35a9729971dda00df7613b88b19a1fd11c.tar.gz |
[master] Honor prefix length hint for returning clients
Merges in rt45780.
Diffstat (limited to 'server')
-rw-r--r-- | server/dhcpv6.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/server/dhcpv6.c b/server/dhcpv6.c index 2665d0e3..cc4b17d6 100644 --- a/server/dhcpv6.c +++ b/server/dhcpv6.c @@ -4664,6 +4664,19 @@ find_client_prefix(struct reply_state *reply) { best_prefix = prefix_compare(reply, prefix, best_prefix); } + + /* + * If we have prefix length hint and we're not igoring them, + * then toss the best match if it doesn't match the hint, + * unless this is in response to a rebind. In the latter + * case we're supposed to return it with zero lifetimes. + * (See rt45780) */ + if (best_prefix && (reply->preflen > 0) + && (prefix_length_mode != PLM_IGNORE) + && (reply->preflen != best_prefix->plen) + && (reply->packet->dhcpv6_msg_type != DHCPV6_REBIND)) { + best_prefix = NULL; + } } /* Try to pick a new prefix if we didn't find one, or if we found an |