Age | Commit message (Collapse) | Author |
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Fix assignment of requested IP address by a client in case the
assignment list is empty.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Rework the static lease logic as the existing logic had different issues.
Static leases are now added in a vlist tree which makes it easier to handle
static lease config changes.
For both DHCPv4 and DHCPv6 static assignments are now created upon the
receival of DHCPv4/DHCPv6 messages as before the static assignment was
created even if the client was not physically present.
In case a hostname is specified in a static lease it won't be overriden
anymore by the hostname received from the client.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Add support for rapid commit according to RFC8415 18.3.1
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Commit 0db69b0b85c83fedd74ac77e850669a17c4e6617 broke parsing of DHCPv6
relay messages as the DHCPv6 client header pointer was not updated
after parsing the nested relay forward message(s).
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Fix compile issue introduced in commit 671ccaabc893b53be8a1891aaf2236b657d6ce06
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Use struct dhcpv6_client_header hdr to access fixed DHCPv6 header fields
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Multiple logical OpenWrt interfaces can be stacked on top of the same
Linux device. As such netlink events for addresses/routes/ifindex changes
need to be propagated to the different logical OpenWrt interfaces
which use the Linux device as reported in the netlink message.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Store the interfaces in an avl tree iso a linear linked list
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Use the logical OpenWrt interface name in syslog printing as multiple
logical interfaces can be defined on top of the same device
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Add CONFIRM support as specified in RFC8415 paragraph 18.3.3
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Fixes :
src/dhcpv6-ia.c:1117:22: warning: variable 'onlink' set but not used [-Wunused-but-set-variable]
for (size_t i = 0, onlink = false; i < addrlen; ++i) {
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Some DHCPv6 clients start sending SOLICIT messages without including either
an IA_NA or IA_PD and only start including an IA_NA or IA_PD in the REQUEST
message without including an IA_PREFIX or IA_ADDR as suboption. As a result
the check to verify if an IA_ADDR and/or IA_PREFIX is onlink fails.
Fix this by returning notonlink if an IA_PREFIX or IA_ADDR suboption is
present having an address/prefix not matching any of the addresses
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Adds the config options to set if DHCPv6 'stateful addresing' hands out
IA_NA (Internet Address - Network Address), IA_PD (Internet Address -
Prefix Delegation), both or none.
Signed-off-by: Matija Amidzic <matija.amidzic@sartura.hr>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Commit 750e457e3000187b85906814a2529ede24775325 added the capability
to filter out prefixes in RAs; however routes were not filtered out
based on the prefixes. This commit fixes this by taking into account
the prefix_filter when constructing the RA route info option
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Make announcing options Recursive DNS server and DNS search list
configurable via the ra_dns config option.
This allows to disable sending RA based DNS info if such info is
already provided by DHCPv6.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Check if odhcpd_get_interface_dns_addr() returns a valid DNS address.
While at it restructure the DNS RA code to make it more readable
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Don't accept 0.0.0.0 and :: as DNS addresses.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Generate a NETEV_ADDR6LIST_CHANGE event in case the preferred lifetime
makes a transition from deprecated (preferred lifetime not greater than
current timestamp) to not deprecated (preferred lifetime greater than
current timestamp)
Reported-by: Tian Hao <haotia@gmail.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
This if statement does the following:
1. Copy the value of "config prefix_filter"
2. Break the string at "/"
3. Save the number after / as prefix length
4. Convert the address before / into in6_addr
However the extraneous "=" broke the second step and inet_pton
failed with addresses with mask. This commit removes the = thus
fixes the feature.
Signed-off-by: Tian Hao <haotia@gmail.com>
|
|
In case IPv6 is not enabled don't try to init DHCPv6/RA and NDP but only
init DHCPv4. This allows odhcpd to start up in absence of IPv6 support.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
In relay mode don't send RA message with router lifetime equal to 0 when
interface gets disabled as router
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Check hostnames contain valid characters as defined in RFC 952 and RFC 1123.
Invalid hostnames in uci configured host entries will result into a refusal
to create the static lease.
In case a client received hostname contains an invalid character no
<hostname> <IP address> entry will be added to the lease file.
In such case the leaseinfo description in the lease file will still contain
the hostname but preceded by the string broken\x20
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Use ODHCPD_ATTR_MAX as array size of odhcpd_attrs
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Invoking ubus methods with NULL message is not supported anymore, so
make sure that network.interface/dump is called with an empty blob buffer
argument.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Check ioctl return value as reported by Coverity in CID1437659
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hyeonsik Song <blogcin@naver.com>
|
|
The border assignment size is not updated by address list change events if
the interface is not configured as DHCPv6 server; therefore set the border
assignment size when an interface is enabled and configured as a DHCPv6
server in order to keep the assignment size in sync with the available
prefix sizes
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Set status code not on link for IAs in DHCPv6 request messages carrying
prefixes/addresses not matching the link prefix(es) to which the client
is connected
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Detected by Coverity in CID1412267
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Detected by Coverity in CID1430899
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Delay the start of the forced renew transaction start with a random delay
between 500 and 1000 ms. This avoids sending DHCP forced renew messages
in case the DHCP client starts sending discover messages triggered by
link state flap.
Also it distributes sending of DHCP forced renew messages to different clients
over an interval instead of sending DHCP forced renew messages in a burst mode.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Don't use an IPv4 address which belongs to the force renew IP address
list as candidate for the DHCP address space calculation logic as
such addresses are installed by the forced renew logic to safeguard
IP connectivity during the forced renew message exchanges and thus
cannot be used to calculate the DHCP address space
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Detected by Coverity in CID1412300
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Detected by Coverity in CID1412413
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
As the odhcpd log verbosity is configurable log renew messages as well.
Fixes logically dead code reported by Coverity in CID1412318
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Detected by Coverity in CID1412349
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Prevent passing negative argument to read; detected by Coverity in CID1412381
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Improve error checking fixing resource leak detected by Coverity in CID
1430880.
Further fix unchecked return value reported by Coverity in CIDs 1430872,
1430839, 1430831 and 1412382
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Fix incorrect sizeof arguments detetced by Coverity in CID 1430866 and
CID 1430893
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Improve error checking fixing resource leakage detected by Coverity in
CID 1430880
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|