summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* allow setting rps/xps defualt values via uciJohn Crispin2017-08-224-9/+43
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* system: remove unused 6rd tunnel attributesHans Dedecker2017-08-211-2/+0
| | | | | | | | 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>
* netifd: allow negative neighlocktime valuesAlin Năstac2017-08-172-3/+3
| | | | | | | | | 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>
* system-linux: parse ipv6 specific tunnel settings as nested data jsonHans Dedecker2017-08-151-101/+115
| | | | object
* system-linux: fix GRE ikey/okey endiannessStijn Tintel2017-07-211-2/+2
| | | | | | | | | 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>
* netifd: Fix printf calls + function declarations.Rosen Penev2017-06-265-16/+16
| | | | | | | | 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>
* ubus: remove superfluous error check in netifd_add_dynamicHans Dedecker2017-06-171-5/+0
| | | | | | | | | | | | | | | | 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>
* iprule: coding style line upHans Dedecker2017-06-111-10/+10
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* iprule: Add option to suppress unspecific routing lookupsStefan Tomanek2017-06-113-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* system-linux: fix 6rd regressionHans Dedecker2017-05-271-1/+1
| | | | | | Fix 6rd regression introduced in commit 7573880ac042c6e5c8d48b1ad83d357b5e02743b Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* system-linux: parse 6rd specific settings as nested json data objectHans Dedecker2017-05-223-32/+76
| | | | | | | 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>
* system-linux: remove redundant check for strtoul() return valueKhem Raj2017-05-191-2/+2
| | | | | | | 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>
* build: disable unknown warning option error in clangFelix Fietkau2017-05-091-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* interface: add new "ifup-failed" hotplug eventMartin Schiller2017-05-093-0/+7
| | | | | | | | | | | 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>
* bridge: reset primary only after marking the member not presentAlex Oprea2017-05-091-3/+3
| | | | | | | | | 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>
* build: suppress format truncation warnings to avoid errors with gcc7Felix Fietkau2017-05-041-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ubus: add interface method to trigger renew eventMatthias Schiffer2017-04-223-0/+24
| | | | | | | | | 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-linux: allow "throw" route typeMatthias Schiffer2017-04-141-1/+2
| | | | | | | system_rtn_aton() was already parsing "throw" correctly, but system_rt() did now allow it. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* netifd: propagate error code on netifd_reload()Alexandru Ardelean2017-04-055-8/+16
| | | | | | | | | | | | | | | 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>
* interface-ip: fix device name for IPv6 link-local DNS serverHans Dedecker2017-04-051-2/+3
| | | | | | | | | | 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>
* interface-ip: set prefix indicator flag when IPv6 prefix lifetime changesHans Dedecker2017-03-211-0/+4
| | | | | | | | 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>
* system-linux: parse vti specific settings as nested json data objectHans Dedecker2017-03-213-15/+33
| | | | | | | 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>
* system-linux: parse gre specific settings as nested json data objectHans Dedecker2017-03-213-19/+54
| | | | | | | Parse gre specific settings ikey, okey, icsum, ocsum, iseqno and oseqno as nested json data object Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* system-linux: add VXLAN supportMatthias Schiffer2017-03-073-1/+181
| | | | | | | | | | | | 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>
* netifd: Add option to configure locktime for each deviceAlin Năstac2017-02-113-0/+33
| | | | | | | | | | | 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>
* interface: add prefix assignment priority supportHans Dedecker2017-02-115-17/+52
| | | | | | | | | | | | | | | | | | | | | | | | | 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]
* device: add veth supportMatthias Schiffer2017-02-115-1/+337
| | | | | | | | | | | | | 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>
* wireless: fix _wireless_add_processGünther Kelleter2017-02-111-2/+2
| | | | | | | 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>
* treewide: fix white space errorsHans Dedecker2017-01-315-26/+23
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* interface-ip: route proto config support (FS#170)Hans Dedecker2017-01-256-8/+70
| | | | | | | | | | | 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>
* device: fix DEV_OPT_SENDREDIRECTS definitionHans Dedecker2017-01-171-1/+1
| | | | | | | | 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>
* bridge: disable IGMP snooping by defaultFelix Fietkau2017-01-131-2/+0
| | | | | | | | | 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>
* netifd: Add sendredirects config supportDaniel Golle2017-01-103-0/+31
| | | | | | | | | | | | | | | | | | | | | | 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>
* proto: allow configuring deprecated static IPv6 addressesMatthias Schiffer2016-12-241-5/+14
| | | | | | | | | 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>
* remove obsolete /opt/local prefix on Mac OS XFelix Fietkau2016-12-241-5/+0
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* system-linux: Don't set gre tunnel ttl by default to 64 (#FS312)Hans Dedecker2016-12-241-8/+15
| | | | | | | | | | As the ttl of a gre tunnel was set by default to 64 the gre tunnel failed to get active if don't fragment was disabled as setting nopmtudisc and ttl is incompatible. Fix this by setting the default ttl value after don't fragment and ttl config values have been parsed. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* ubus: Display the IPv6 prefix assigned addressHans Dedecker2016-12-121-1/+10
| | | | | | | | | Display the IPv6 address obtained from a prefix assignment as local-address element in the ubus ipv6-prefix-assignment list so it's explicitly clear which IPv6 address from the delegated prefix is assigned to interface. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* device: Use device_find for better readibility in device_createHans Dedecker2016-11-221-1/+1
| | | | | | | Use device_find in device_create so it's clear a device lookup is being done in the device list. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* ubus: Use device_find to find a device when displaying device infoHans Dedecker2016-11-221-1/+1
| | | | | | | | | | | | Replace device_get by device_find in netifd_dev_status as device_get will fail to find the device if it's created via config as an aliased vlan device in dotted notation (eg @iface.200). In such case get_vlan_device_chain will figure out the layer3 device but get_vlan_device will not find the vlan device in the dependency list of the layer 3 device as it has been created as a dependency of the aliased device. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* bridge: fix MAC address override on config reloadFelix Fietkau2016-11-221-0/+3
| | | | | | | | | When no MAC address option is given, the MAC address of bst->primary_port is used to override the bridge device address. When the config changes and a new MAC address is provided in the config, bridge_reset_primary needs to stop overriding it Signed-off-by: Felix Fietkau <nbd@nbd.name>
* system-linux: cosmetic cleanupFelix Fietkau2016-11-041-1/+3
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* system-linux: check for open failureGünther Kelleter2016-11-041-0/+2
| | | | Signed-off-by: Günther Kelleter <guenther.kelleter@devolo.de>
* interface: Fix triggering of interface update eventHans Dedecker2016-11-043-8/+10
| | | | | | | | | | | | | | | | | In case the keep flag is set in proto_shell_update_link no interface update event is triggered when IPv4/6 addresses/routes/... are updated as the proto_event callback is not called due to keep being set. Unconditionally call the proto_event callback handler in proto_shell_update_link but let the proto_event callback handler; in this case interface_proto_event_cb, decide which actions need to be taken dependant on the interface state. In case the interface is already in the up state trigger an update event only if the interface updated flag actually indicates either an IP address/ route/data change; before interface update events were actually sent wihtout any parameter change. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* wireless: Call wireless_interface_handle_link before deleting the vifHans Dedecker2016-11-041-0/+1
| | | | | | | Similar as when updating a vif; call wireless_interface_handle_link removing the vif from the network when deleting a vif Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* bridge: Don't use device name as bridge member nameHans Dedecker2016-11-041-7/+12
| | | | | | | | | | | The bridge name is a copy of the device name; but the device name can change which is the case when an aliased interface is used as bridge member. This will result into unwanted side effects like bridge reload triggering a topology change effect after doing network reload; therefore use the configured ifname as fixed bridge member name. Also don't display bridge member devices which are hidden Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* proto-shell: add helpers for generic options in proto handlersMarcin Jurkowski2016-10-271-0/+13
| | | | | | | | Adding helpers for virtual interfaces generic options in ncm, qmi, mbim and directip protocols as suggested by Felix in https://lists.openwrt.org/pipermail/openwrt-devel/2016-February/039794.html Signed-off-by: Marcin Jurkowski <marcin1j@gmail.com>
* device: ignore MTU values below minimumFelix Fietkau2016-09-281-2/+2
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* device: Drop device down event during device release if device gets active againHans Dedecker2016-09-261-0/+4
| | | | | | | | | | | | Fixes a race condition as the device can be active again; due to a device_claim; by the logic behind the set_state device type function. In this case the down event cannot be sent anymore as it would bring down the interface(s) referencing the device. This can be the case for an aliased device when the underlying device is switched during a reload; the alias_set_device function can add a new dependency on the new active device which will put the aliased device in active mode again as the aliased device is already claimed by the interface using it. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* vlandev: Rework 8021ad/8021q detection based on vlandevice typeHans Dedecker2016-09-261-9/+4
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* vlandev: Register 8021ad and 8021q s device typesHans Dedecker2016-09-261-3/+14
| | | | | | Fixes creation of vlan 8021ad/8021q devices by UCI due to device handlers rework Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>