Age | Commit message (Collapse) | Author |
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
This avoids creating invalid routes in cases where another daemon is
handling local routes for an interface, e.g. on mesh interfaces
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
It is overly complex, yet does not cover common scenarios very well.
It will be replaced with a simpler shell script that provides a better
default policy
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
|
|
When ubus invokes proto_dump_handlers, and a struct proto_handler has
been added with a NULL config_params, a segmentation fault occurs.
Avoid this segmentation fault by checking for a NULL config_params
before further access.
Signed-off-by: Olof Sivertsson <olof.sivertsson@zenterio.com>
|
|
Check if a mac address is actually present when generating an eui64 based
IPv6 address; in case of failure bail out.
At the same time make sure the active mac address is used as input for the
eui64 based IPv6 address and guarantee IPv6 prefix address generation is
based on the actual config by resetting the IPv6 prefix address in the
assignment structure when it gets deleted.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Don't generate an IPv6 prefix address without taking into account the
interface state. In case eui64 is configured to generate the ifaceid this
could fail as the layer3 device mac address could not yet be available if
the interface is not yet in setup or up state.
While at it remove the interface metric assignment as this is already done
by the function interface_set_route_info.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
The `is_error()` is just a macro that checks
that object is NULL (which is considered an error
in libjson-c terminology).
Newer libjson-c versions have deprecated this.
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
|
|
Commit 2f31bff38d4dc2f36006ded6b8a7d039cb569eaa added interface routing
table support; as a result for IPv6 the prefix route linked to the IPv6
address is added to the specified IPv6 interface routing table.
In order to route traffic having as destination the IPv6 prefix a policy
rule is required using the prefix destination as policy so the traffic is
passed to the correct routing table.
The IPv6 prefix address logic was not installing this policy rule effectively
breaking routing when trying to reach a global or ULA IPv6 address in the
lan from either the device or another wan device.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Add config support support for point-to-point IPv4 addresses by providing
the uci parameter ptpaddr. This allows to support a gateway being in a
different subnet than the assigned IP by modeling the local IP having a
point-to-point address.
This is similar to the point-to-point IPv4 address support already present
for the protocol handlers.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
|
|
Display the point-to-point IPv4 address as well when dumping
the IP address list in ubus.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Return the more approriate error code UBUS_STATUS_NOT_FOUND in case
network reload fails
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Wireless config is optional as not all targets have a wireless interface;
therefore don't report an error if the wireless config is missing so
network reload is not reporting an error to the user.
While at it use netifd_log_message to print an error if the config cannot
be loaded.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
If you rename a network interface, there is a move uevent
invoked instead of remove/add.
This patch adds support for this kind of event.
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
Acked-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Parse map-e fmrs parameters IPv6 prefix, IPv4 prefix, ealen and offset
as array elements nested in a data json object.
At the same time remove the now obsolete TUNNEL_ATTR_FMRS tunnel attribute.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: John Crispin <john@phrozen.org>
|
|
Commit 7573880ac042c6e5c8d48b1ad83d357b5e02743b added support for 6rd
attributes as a nested json data object which makes the attributes
TUNNEL_ATTR_6RD_PREFIX and TUNNEL_ATTR_6RD_RELAY_PREFIX unused
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
When -1 is written in /proc/sys/net/ipv4/neigh/<iface>/locktime,
kernel disables ARP trashing protection. A value of 0 does not completely
disable this protection, a second ARP update being discarded if it
is processed during the same jiffie as the first update.
Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
|
|
object
|
|
The kernel expects IFLA_GRE_IKEY and IFLA_GRE_OKEY to be in network byte
order, so convert the values from host byte order.
Fixes ikey/okey on little endian systems.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
|
|
cppcheck found printf functions with signed instead of unsigned
formats. Fix those as well as some non-matching function
declarations.
Signed-off by: Rosen Penev <rosenp@gmail.com>
|
|
Check for main device and main device having default config for a dynamic
interface was orginally added in commit 266d92dd83bd5bfe520f3e2838794bf9bb827c07
with as purpose to set the device config. The latter was later removed in
commit 4bf89afc22b43d5bd155d32d3998348a77179c1a which makes the device checks
superfluous.
Also not all interfaces have a main device (eg tunnel interfaces) resulting
into netifd_add_dynamic returning an error code when such interfaces are added.
As an example 6rd interfaces dynamically added by the DHCP script the log
messages are cluttered with the trace 'wan (7803): Command failed: Unknown error'
after each DHCP renew.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
After applying this patch, policy routing rules can be employed that ignore
parts of a routing table. The following config snippet ignores routing lookups
from the specified main routing table yielding the default route, passing the
lookup process on to the next rule (that might provide a special default route
for marked packets):
config rule
option priority 10
# check main routing table first, but ignore default route result
option lookup main
option suppress_prefixlength 0
config rule
option priority 11
# use special routing table for marked packets
# (unless already consumed by previous rule)
option mark 0xFF
option lookup 100
The result is a ruleset like this (only visible using the full 'ip' binary):
# ip rule
0: from all lookup local
10: from all lookup main suppress_prefixlength 0
11: from all fwmark 0xff lookup 100
32766: from all lookup main
32767: from all lookup default
#
Signed-off-by: Stefan Tomanek <stefan.tomanek@wertarbyte.de>
|
|
Fix 6rd regression introduced in commit 7573880ac042c6e5c8d48b1ad83d357b5e02743b
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Parse 6rd specific settings prefix, relay-prefix as nested json data objects.
At the same time improve 6rd error handling.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Fixes
system-linux.c:1998:33: error: comparison of unsigned expression >= 0 is always true [-Werror,-Wtautological-compare]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
This hook makes it possible to do some helper work in hotplug scripts
when a connection is not established successfully.
example: try several username/passwords from a pool to establish a
pppoe or wwan connection by replacing the configured values of the
connection in a hotplug script.
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
|
|
Run the bridge_reset_primary function only after the member being removed
has been marked as not present.
This change prevents the bridge_reset_primary function from choosing the
member being removed as the new primary member.
Signed-off-by: Alex Oprea <alex.oprea@inteno.se>
|
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Not all topology or connectivity changes may be detected by netifd,
depending on the underlying technology (e.g. VPN software); this adds a way
to explicitly trigger a renew.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Acked-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
system_rtn_aton() was already parsing "throw" correctly, but system_rt()
did now allow it.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
|
|
The context is that we generate some of the UCI config
for netifd via scripts/programs.
Every once in a while, there's a goof when doing that
UCI generation, and netifd prints out the error at
stderr, but returns 0 (success) err-code.
This change will fail the ubus call if UCI config
is invalid or missing for /etc/config/network.
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Acked-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Commit 235a02424c3ab1b59308895c4f00395dacf2557c adds support for IPv6 link-local
DNS server by appending the device name; however the interface ifname parameter
does not always contain the layer 3 device name (e.g it can hold the aliased
interface name)
Fix this by passing the device name of the referenced layer 3 device.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Trigger interface update event when IPv6 prefix lifetime changes by setting
the prefix indicator flag to inform external subsystems (eg hnetd) about IPv6
prefix lifetime changes.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Parse vti specific settings ikey and okey as nested json data object.
At the same time remove the now obsolete TUNNEL_ATTR_INFO attribute.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Parse gre specific settings ikey, okey, icsum, ocsum, iseqno and oseqno
as nested json data object
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
VXLAN shares many attributes with the tunnel devices, so it is implemented
as a new tunnel type. The 'remote' attribute can be used for an unicast
peer or a multicast group.
The IANA-assigned port 4789 is used by default, instead of the non-standard
port Linux defaults to.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Acked-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
The UCI parameter neighlocktime allows to control the hardware
address to IP mapping lock time in the IPv4 neighbour table.
The IPv6 lock time was not set because it is not used at all in any
kernel versions, hardware address override being controlled in this case
by the override flag present in the NA packet.
Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
|
|
In case of prefix delegation prefixes are assigned to one or more
configured downstream interfaces. The delegated prefix length in
combination with the assignment length of the downstream interfaces
determines the number of subnets which can be allocated from the
delegated prefix.
The interface ip6weight parameter allows to prioritize the allocation
of subnets to interfaces in case of multiple configured downstream
interfaces.
The order of interface prefix assignment from a delegated prefix is
based on the following parameters:
- Primary key is prefix assignment based on the configured interface ip6hint
- Secondary key is the requested downstream interface prefix length,
interfaces configured with the smallest ip6hint will be assigned first
- Third key is the assigned interface ip6weight in case of equal prefix
assignment length; interfaces having the highest ip6weight will be
assigned first
- Finally the alphabetical order of the interfaces in case of equal
ip6weight
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name> [cleanup]
|
|
The veth config code mostly handles the primary interface of a veth pair,
the secondary interface is not explicitly referenced and will be found as
an unrelated interface after the pair has been created.
This doesn't only allow us to keep the veth code simple (and similar to
existing device handlers), but will also avoid complicating handling
unnecessarily in case the secondary interface is moved into another network
namespace.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
|
|
The pid is in $1, not $pid.
Use proper test condition for nonmatching exe warning.
Signed-off-by: Günther Kelleter <guenther.kelleter@devolo.de>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Route proto support is usefull when using route distribution
via a routing daemon.
The route proto parameter can be specified via the route proto
uci config parameter, it can hold a numerical value or the string
values unspec, kernel, boot, static or a string present in
/etc/iproute2/rt_protos.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Commit abf52371db75eb449f12209ca1b7ffaa9d2baa22 adds sendredirects
device config support by defining DEV_OPT_SENDREDIRECTS. Fix definition
overlap of DEV_OPT_SENREDIRECTS with DEV_OPT_LEARNING.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Lots of configurations have triggered various issues in this feature,
any many people don't even need this.
Let's disable it by default until it has become more stable
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Setting /proc/sys/net/ipv4/conf/*/send_redirects is useful if a single
layer-2 domain is shared among routed subnets.
Sending redirects will prevents traffic from taking unnessesary detours
through a gateway in cases where direct connectivity on layer 2 exists.
This is commonly the case if an existing LAN infratructure with dump
switches is used to additionally carry routing protocols like OLSR
which are supported only by some nodes on the network.
It's important to note that the default value for send_redirects
differs for interface types (it's enabled on physical ethernet
interfaces, but disabled e.g. on VLANs) due to olsrd changing
/proc/sys/net/ipv4/conf/default/send_redirects during boot, thus the
default differs also depending e.g. on the way an on-board switch is
integrated on specific boards (as eth0 exists before olsrd is started,
eth0.1 gets created by netifd later on...)
Having a way to explicitely enable or disable send_redirects is
thus desireable also to unify the default behaviour among different,
but seemingly similar devices supported.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|
Add a new boolean attribute ip6deprecated to the static protocol which can
be used to mark IPv6 addresses as deprecated (i.e., set the preferred
lifetime to 0). This is useful to configure addresses that may be used for
incoming, but not for outgoing connections unless bound explicitly.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
|