summaryrefslogtreecommitdiffhomepage
path: root/src/dhcpv6-ia.c
AgeCommit message (Collapse)Author
2017-01-06dhcpv6-ia: filter out prefixes having invalid lengthHans Dedecker
Function append_reply filters out addresses having invalid prefix length when constructing prefixes being delegated to a client. Now also filter out addresses with an invalid prefix length when writing the delegated prefixes in the statefile and during logging of the delegated prefixes. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-05dhcpv6-ia: fix dereference after freeing assignmentHans Dedecker
Fix assignment dereference by dhcpv6_log in case the assignment is freed when nothing has been assigned. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-05dhcpv6-ia: log only IPv6 addresses which are effectively assigned to a ↵Hans Dedecker
DHCPv6 client Fix displaying IPv6 addresses which were not assigned to a DHCPv6 client Clean up the code by using macro ADDR_ENTRY_VALID_IA_ADDR on different places to align the checks. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-03dhcpv6-ia: fix static assignment checkHans Dedecker
Fix static assignment check failure which was introduced in commit 561890e Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-02dhcpv6-ia: coding style fixesHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-02dhcpv6-ia: update valid_until only for non static DHCPv6 leasesHans Dedecker
Update valid_until lifetime only for non static DHCPv6 leases otherwise the lifetime of a static lease is not infinite anymore Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-30dhcpv6-ia: fix invalid IPv6/hostname entries in statefileHans Dedecker
Statefull IPv6 addresses are assigned to DHCPv6 clients from a local prefix based on criteria which need to be fulfilled. One of those criteria requires the IPv6 address still having preferred lifetime which was not checked when constructing the contents of the statefile. Another criteria requires the prefix length not being smaller than or equal to 64 when ra_management equals 0 or 1 which was neither correctly checked when constructing the statefile. This can lead to invalid hostname/IPv6 entries in the statefile and thus possible connectivity issues when using DNS resolving. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-30dhcpv6-ia: fix delete logic of an assignment in reconf_timerHans Dedecker
Function free_dhcpv6_assignment already removes the assignment in the list so there's no need to call list_del in reconf_timer Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-30dhcpv6-ia : code style fixesHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-28dhcpv6-ia: use free_dhcpv6_assignment where neededHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-28dhcpv6-ia: make free_dhcpv6_assignment staticHans Dedecker
Further align coding style Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-28dhcpv4: fix DHCPv4 hostname handlingHans Dedecker
Fix hostname not being reported as "-" in the DHCP statefile in case no hostname is reported by the DHCPv4 client (https://:wqgithub.com/openwrt/odhcpd/issues/94) Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-27Limit lifetime of non-static leases in case of release and declineHans Dedecker
In case infinite leasetime is assigned to a non static DHCPv4/v6 lease override the infinite lifetime of the lease when either a DHCPv4/v6 decline or release is received. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-15Don't print non bound assignments in the state fileHans Dedecker
Set bound flag for DHCPv4 and DHCPv6 assignments when the IPv6/IPv4 address is leased to a client. This will prevent the printing of leases and hostname/IPv4/IPv6 address combinations in the state file for for which the IPv4/6 address has not been assigned. Also this will fix the printing of assignments which have been declined by the clients Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-01dhcpv6-ia : Fix static DHCPv6 assignments becoming non staticHans Dedecker
The valid_until parameter which is set to 0 for static DHCPv6 assignments was overwritten depending on the received DHCPv6 message which turned the assignment into having a finite lifetime and thus not static anymore. Fix this by checking if the valid_until parameter holds infinite lifetime before updating it. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-01dhcpv6-ia: Fix assignment of static DHCPv6 leasesHans Dedecker
Fix assignment of static DHCPv6 leases which was broken by commit 6c3bc0141dacc88992583d6f2cdc8a360df7422d. At the same time fix lifetime check of existing assignments having a finite lifetime Fixes FS#309 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-01odhcpd: Display infinite valid lifetime as -1Hans Dedecker
Display infinite valid lifetime as -1 both in ubus and statefile Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-11-21dhcpv6-ia: Display infinite lifetime as INT32_MAX in state fileHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-11-21config: Support infinite as DHCP pool leasetime valueHans Dedecker
Add support for infinite leasetime value; this can be done by specifying "infinite" as leasetime value which is similar to dnsmasq infinite leasetime support. Specifying "infinite" as leasetime is valid for both the host and dhcp uci sections. A DHCPv4/DHCPv6 assignment is now considered infinite if valid_unil holds the value 0. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-05-19Add per-host leasetime supportSteven Barth
Patch by Daniel Dickinson Signed-off-by: Steven Barth <steven@midlink.org>
2015-09-07dhcpv6: use correct length when copying duidSteven Barth
2015-09-07dhcpv6: fix mac-handlingSteven Barth
2015-09-01Fixup RAs/DHCPv6 announcing incorrect addressesSteven Barth
2015-08-13router: Fix compile issuesHans Dedecker
Fix compile issue due to comparison between signed and unsigned integers
2015-07-27ra/dhcpv6: unify address change handlingSteven Barth
2015-07-14ndp: fixup relaySteven Barth
2015-05-21dhcpv6: fix typoSteven Barth
2015-05-13dhcpv6-pd: ignore /64 on interfaceSteven Barth
2015-04-20dhcpv6: don't initialize IA-handing when turning down interfaceSteven Barth
2015-04-20remove leftover fallout from prefix class supportSteven Barth
2015-04-14Fix logic inversionSteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2015-04-14Fix potential invalid memory accessSteven Barth
2015-04-06dhcpv6: fix handling of infinite lifetimesSteven Barth
2015-03-30properly handle return codesJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2015-03-30dhcpv6: fix default assignment of non-64Steven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2015-03-30dhcpv6: prefer ula over other globalsSteven Barth
2015-03-29Fix hostname exportSteven Barth
2015-03-29Remove prefix coloring support, refine hybrid management modeSteven Barth
2014-11-06DHCPv6: enable flash-renumbering hack only for /64 prefixesSteven Barth
2014-10-18dhcpv6: fix calculation of T1 and T2Steven Barth
2014-10-16dhcpv6: allow flash renumbering in hybrid management modeSteven Barth
2014-08-19Fix compilation errors in last commitSteven Barth
2014-08-19dhcpv6-ia: add loggingSteven Barth
2014-08-13PD: don't consider deprecated assigned prefixes when calculating avilable PD ↵Steven Barth
size
2014-08-08Add host-entries for all IPv6 addressesSteven Barth
2014-08-07sync hostfile more oftenSteven Barth
2014-07-23Don't loose routes in managed PDSteven Barth
2014-06-30leasefile: do not output expired dhcpv6 leasesNikolay Martynov
Sometimes ip that is assigned to a host changes, old ip is still kept aroung as 'expired'. This expired ip gets dumped into leasefile and is read by dnsmasq. The result is that hotsname is resolved into expired ip and that confuses clients. This patch prevents expired leases from being written into leasefile.
2014-06-17use leaetime as base for T1 and T2 upper boundSteven Barth
2014-06-17backup for notonlinkSteven Barth