Age | Commit message (Collapse) | Author |
|
"ipv6-prefix": [
{
"<some ipv6 address>",
"preferred-lifetime": 37979,
"valid-lifetime": 48779,
"prefix-length": 63
}
],
json object is missing key, set address as key name.
Line up DHCPv4 lease json info by using key name "address"
Signed-off-by: Mislav Novakovic <mislav.novakovic@sartura.hr>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Improve error checking; fixes resource leak detected by Coverity
in CID 1430925
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Detected by Coverity in CID 1433363 and 1432121
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Improve error checking fixing resource leakage detected by Coverity in
CID 1433402
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Fix strncpy bounds as reported by Coverity in CID 1412278 and 1412293
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Assign tentative assignments a lifetime of 60 seconds; this will assure
the assignment is seen as valid during lookup when receiving a later
REQUEST from the DHCPv6 client.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Whe doing an assignment lookup do a strict match between the assignment
IAID and the IAID received form the client in case the BOUND or TENTATIVE
assignment flags are set.
This fixes a wrong assignment being returned for a client which uses a
different IAID than the IAID used in a previous DHCPv6 exchange.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Don't announce managed address configuration in case DHCPv6 is disabled
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Send Router Information Option as well for prefixes with length 64 in order
to be compliant with L-3 in RFC7084: An IPv6 CE router must advertise
itself as a router for the delegated prefixes using the "Route Information
Option".
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Send reconfigure accept and reconfigure key authentication protocol options
only if the client indicates it supports reconfigure accept as descibed
in RFC3315 paragraph 21.5.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Saves a few bytes.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
|
IETF is moving toward implementing IPv6 multihoming by sending
multiple RAs on a single interface:
- draft-ietf-intarea-provisioning-domains-00
- draft-ietf-rtgwg-enterprise-pa-multihoming-02
odhcpd supports configuration of multiple software interfaces
on the same physical interface, which already advertises
multiple RAs, but had two issues:
- Each RA includes all the prefixes available on the interface.
- Replies to sollicits with a single RA.
This patch introduces the prefix_filter configuration parameter
which allows filtering prefixes that are sent in a given RA,
and fixes the sollicit code in order to reply with all the RAs
that are configured on a given interface.
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
|
|
If the ubus object has any subscription notify DHCP ACK and DHCP RELEASE
events using ubus notifications.
Signed-off-by: Borja Salazar <borja.salazar@fon.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Fixes gcc 7 build errors
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Make DHCPv4 support compile time configurable; avoids DHCPv4 functionality
overlap with other packages.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Rework the handling of netlink events by letting the different
modules ndp, ra, dhcpv6 and dhcpv4 install netevent handlers.
The installed netevent handlers are called by the netlink logic
passing an event indication together with event data.
Each netevent handler implements its own event logic; this
makes the code more modular and less complex by moving all
netlink code to netlink.c
While at it rename ia_addr and ia_addr_len into addr6 and
addr6_len respectively
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
First step in moving netlink code to netlink.c by
moving netlink code from odhcpd.c to netlink.c
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
When receiving a DHCPv4 message use find_assignment_by_hwaddr to find
an assignment as only one entry can be present in the assignment table
for a given mac address.
While at it pass requested address by the client as an uint32_t type
to clean up the code.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Don't rely on incoming DHCPv4 messages to trigger the lease expire
detection logic but rather use a periodic timer which checks every
second if a lease is expired
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Support force renew nonce authentication support in the DHCPv4 server as
described in RFC3203 and RFC6704.
The interface uci arameter dhcpv4_forcereconf allows to supports DHCPv4
clients which support force renew without authentication.
While at it align network byte order logic for simplicity.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Remove the unfortunate RELAYD naming in the different macros
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Use IPv4 address list in check_addr_updates which fixes possible segfault
as IPv6 address list was used by mistake.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Rework reconfigure accept retransmission logic; every DHCPv6 assignment
has its own reconfigure accept timer now making sure the timeout and
retransmission behavior is in line with RFC3315 paragraph 19.1.2.
While at it rename the original reconf_timer into valid_until_timeout as
it will only check now the lifetime of the assignments.
Set reconf_cnt to INT_MAX for every assignment which belongs to the same
client identifier; before the reconf_cnt of the first handled assignment
was set by mistake breaking the retransmission logic.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Align IPv4 address logic with IPv6 by caching per interface the assigned
IPv4 addresses. This allows to get rid of different ioctl calls in the
DHCPv4 logic to retrieve the IPv4 address and netmask in use by an
interface.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Some client implementations expect DHCPv6 addresses to be assigned for
every prefix present in a RA as reported in FS#524; if not done the
client implementations spam the DHCPv6 server with SOLICIT messages
trying to get an DHCPv6 address for every prefix.
When ra_managed is set to 1 and an ULA prefix is configured; the DHCPv6
server will only assign an ULA DHCPv6 addresses which possibly leads to
DNS issues.
Fix these problems by providing dhcpv6_assignall config option which
assigns all viable DHCPv6 addresses to a client by default.
This is a trade off as it means client implementations will be assigned
more IPv6 addresses and lose the ability to quickly renumber clients
which don't support reconfigure accept in case of wan prefix change
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Improve code readability by renaming managed into ra_managed and
define the according ra_managed flags.
This will help to better understand the ra_managed logic as defined
in the README file.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Retrieve IPv6 interface addresses when the interface gets created; this
allows to get rid of the IPv6 address dump logic in ndp.c.
Add IPv4 address support in odhcp_ipaddr struct.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Improve code maintainability by using enum to order and index iov struct
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Rework code to get rid of RELAYD_MAX_PREFIXES and RELAYD_MAX_ADDRS
by using dynamic IPv6 address array allocation.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Get rid of IFNAMSIZE usage for interface name and ifname variables
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Don't send an invalid hoplimit in RA message when
the interface is shutdown due to a invalid configured
ra_hoplimit.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Don't send an invalid retranstime in RA message when
the interface is shutdown due to a invalid configured
ra_retranstime.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Don't send an invalid reachabletime in RA message when
the interface is shutdown due to a invalid configured
ra_reachabletime.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Limit the maximum ra_mtu to 65535
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Use integer type for mtu variable as odhcpd_get_interface_config returns
-1 when it fails to read the interface mtu. This allows to set the mtu
to a meaningfull value of 1280 in case of interface mtu read failure.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Limit the maximum ra_retranstime value to 60000 milliseconds as
described in RFC7048.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Leon M. George <leon@georgemail.eu>
|