Age | Commit message (Collapse) | Author |
|
Only log a syslog error in case adding of a proxy neighbor fails as a delete
failure cannot be considered as a syslog error for all cases.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Get rid of the global raw ICMPv6 socket by creating a raw ICMPv6 ping socket
per interface. This fixes an open raw ICMPv6 socket in case all ndp interfaces
are configured as disabled.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Initialzie properly the dhcpv6, dhcpv4 and ndp ffile descriptors
when creating an interface.
As such the check for a valid descriptor can be done correct now
in the different modules
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
In case multiple logical OpenWrt interfaces are stacked on the same device
and one of the interfaces is configured in relay and the other not; adding
a proxy neighbor entry will result into it immediately being deleted if
the interface in non relay mode comes last.
Fix this by not doing a delete on the interface which is not configured in
relay mode.
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>
|
|
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>
|
|
Saves a few bytes.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
|
Fixes gcc 7 build errors
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>
|
|
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>
|
|
Remove the unfortunate RELAYD naming in the different macros
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Fixes gcc 7 build errors
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
A ping for an IPv6 address not present on an interface will generate a
netlink neighbor message with as status fail; launching again an IPv6
ping on other proxy enabled interfaces will create a cascade effect of
netlink neighbor messages with as status fail which in its turn will
again trigger an IPv6 ping on proxy enabled interfaces ...
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Proxy neighbor entries were not created for proxy enabled interfaces
if the first interface was not enabled
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Don't reset the final 32 bit IPv6 host suffix when storing the IPv6 addresses
in the interface structure. This will allow exact lookup aand return of IPv6
addresses stored in the interface structure when needed.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Make the code more logical by moving the IPv6 address dump logic into the
different protocol interface enable handlers so it's clear which protocols
require interface IPv6 address tracking.
At the same time restructure the IPv6 address dump logic so less IPv6 address
netlink dumps are created.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Add extra LOG_DEBUG syslog tracing for trouble shooting
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Deregister netlink event socket in case of error different
from ENOBUFS or failure to set netlink rx buffer size
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Start with a netlink receive buffersize of 130k for the netlink event socket;
double the netlink receive buffer size in case an ENOBUFS is reported.
Also align function naming and its parameters.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Rework the IPv6 relay logic to make it more robust by making
use of libnltiny to process netlink messages.
At the same time reimplement the IPv6 relay finite state machine
to make the relay logic less error prone
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Use libnl-tiny to construct and process netlink messages when
manipulating IPv6 routes and fetching IPv6 addresses.
This fixes lingering netlink error messages on the netlink socket
in case route deletion failed causing fetching of IPv6 addresses
to be aborted and odhcpd faultly assuming no IPv6 addresses being
present on the interface.
|
|
Rework prio of syslog messages allowing to filter out the relevant messages
by setting the correct log level
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
ia_reconf is only set but nowhere used; so let's remove it ...
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
In case a netlink route event is received for a default route
netlink data attributes were faulty processed as neigbor netlink
data. Fix this by not processing any netlink attribute for
any route event.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|