diff options
author | SUZUKI, Shinsuke <suz@kame.net> | 2007-03-22 05:26:21 +0000 |
---|---|---|
committer | Bjørn Mork <bjorn@mork.no> | 2010-08-06 15:37:36 +0200 |
commit | fe3d6ca944917ec34247e029218f8ca11975cc30 (patch) | |
tree | bd57455abdc29aaa0ebf02039e1985d8ca45a8be /lease.c | |
parent | 484766b9467ac3a3e35eb465da6bfd825f749bd5 (diff) |
implemented DHCPv6 Decline message processing on DHCPv6 server.
Diffstat (limited to 'lease.c')
-rw-r--r-- | lease.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -56,8 +56,12 @@ struct hash_entry { LIST_ENTRY(hash_entry) list; char *val; + char flag; /* 0x01: DHCP6_LEASE_DECLINED */ }; +/* marked as declined (e.g. someone has been using the same address) */ +#define DHCP6_LEASE_DECLINED 0x01 + LIST_HEAD(hash_head, hash_entry); typedef unsigned int (*pfn_hash_t)(void *val) ; @@ -141,6 +145,27 @@ release_address(addr) } } +void +decline_address(addr) + struct in6_addr *addr; +{ + struct hash_entry *entry; + + if (!addr) + return; + + dprintf(LOG_DEBUG, FNAME, "addr=%s", in6addr2str(addr, 0)); + + entry = hash_table_find(&dhcp6_lease_table, addr); + if (entry == NULL) { + dprintf(LOG_WARNING, FNAME, "not found: %s", + in6addr2str(addr, 0)); + return; + } + + entry->flag |= DHCP6_LEASE_DECLINED; +} + int is_leased(addr) struct in6_addr *addr; |