Age | Commit message (Collapse) | Author |
|
|
|
src/odhcpd.c:143:2: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
snprintf(buf, sizeof(buf), sysctl_pattern, ifname, what);
^~~~~~~~
cc1: all warnings being treated as errors
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Adds the config option to set if ipv6 dns service is availiable on the
interface. In some cases the dns service may not be listening on the
ipv6 address of the interface, and thus should not be announced to clients.
Signed-off-by: Paizhuo Chen <cc@icpz.dev>
|
|
GCC10 mandates the C++ one definition rule, which breaks on multiple
definitions of config. Add the appropriate extern declaration.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
SYS_clock_gettime is gone with musl 1.2.0. Switched to the function.
Also fixed two format strings that fail as time_t is 64-bit with 1.2.0.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
|
Since main problem of assuming that fd==0 is invalid value
was fixed in upstream odhcpd by e7b1d4bf3a2297192638b9c84208b3dcb306ecd8
then what is left are minor problems of static initialization
of some global fd variables.
Signed-off-by: Dainis Jonitis <dainis.jonitis@ubnt.com>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Hyeonsik Song <blogcin@naver.com>
|
|
Detected by Coverity in CID1412300
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 strncpy bounds as reported by Coverity in CID 1412278 and 1412293
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>
|
|
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>
|
|
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>
|
|
Remove the unfortunate RELAYD naming in the different macros
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>
|
|
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>
|
|
Don't return anymore the link local IPv6 address as DNS IPv6 address
since different OS implementations (e.g. android, ...) cannot handle
a link local IPv6 address as DNS address.
IPv6 DNS address selection is reworked as follows :
-Consider all global/ULA IPv6 address having a valid lifetime
-Give preference to global/ULA IPv6 addresses being not deprecated
-Give preference to ULA IPv6 addresses over IPv6 global addresses
-Give preference to the IPv6 address with the longest preferred lifetime in
its selected category (ULA or global)
-If no global/ULA IPv6 address is present use the IPv6 link local address
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
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>
|
|
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>
|
|
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.
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Rework the IPv6 address dump logic to make it more robust
and generate syslog traces in case of error situations
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Add extra syslog tracing for trouble shooting
and make some syslog traces more self explaining
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Currently the loglevel is hardcoded to LOG_WARNING, even though there is
debug log messages. Allow setting the loglevel via cli option.
Include basic help text because we're adding command line options.
Signed-off-by: Karl Palsson <karlp@etactica.com>
|
|
Drop pointless syslog. The single line just doubles the amount of lines
logged to syslog without adding any value.
Signed-off-by: Karl Palsson <karlp@etactica.com>
|
|
|
|
|
|
|
|
|
|
|