summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* wireless: Add Opportunistic Wireless Encryption (OWE)Hauke Mehrtens2018-10-121-1/+4
| | | | Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* wireless: Add Simultaneous Authentication of Equals (SAE)Hauke Mehrtens2018-10-121-1/+7
| | | | | | This adds PSK3 / SAE support. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* iprule: coding style fixesHans Dedecker2018-10-011-15/+16
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* iprule: fix segfault (FS#1875)Hans Dedecker2018-10-011-6/+2
| | | | | | | | | | | | Fix segfault in generic_interface_cb by checking the IPRULE_OUT/IPRULE_IN flags before doing the strcmp for the possible configured out/in interface(s) of the ip rule. Also don't copy the interface layer3 device as the layer 3 device is not yet known when IFEV_CREATE event is launched. The layer3 device will be known when the IFEV_UP event is processed in rule_out_cb/rule_in_cb. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* scripts: fix previous commitJo-Philipp Wich2018-09-191-1/+1
| | | | | | | Actually change the glob pattern as described in the previous commit. Fixes: 3c8ac1c ("netifd: fix wpa mixed mode matching") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* netifd: fix wpa mixed mode matchingRick Farina (Zero_Chaos)2018-09-191-1/+1
| | | | | | | | | | | | | Change wpa mixed mode matching to not accidently catch wep+mixed. All documented cases have the character between {wpa,psk} and mixed as a '-' but no need to break things which were working, so preserve the * case. Reported-by: "Rick Farina (Zero_Chaos)" <zerochaos@gentoo.org> [Allow "psk-mixed" to be prefixed, to align with the *psk2* and *psk* cases, slightly reword subject and commit message.] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* system-linux: enable by default ignore encaplimit for ip6 tunnelsHans Dedecker2018-09-181-2/+5
| | | | | | | | | | | Enable ignore encaplimit by default for ip6 tunnels as not all ISPs support the destination option header containing the tunnel encapsulation limit resulting into broken map/ds-lite connectivity. Setting the ignore encaplimit flag by default is a more sane setting as it avoids user configuation of the encaplimit uci option for ds-lite/map tunnels in case of broken connectivity. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* CMakeList: Check that compiler supports -Wimplicit-fallthroughFlorian Fainelli2018-09-111-1/+11
| | | | | | | This is a GCC >= 7 feature, not all compilers support it. Fixes: 908a9f4f1027 ("CMakeLists.txt: add -Wimplicit-fallthrough to the compiler flags") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
* interface: let interface_set_down() return voidHans Dedecker2018-08-202-4/+2
| | | | | | | Let interface_set_down() return void as no usefull error code is returned by __interface_set_down() Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* interface: make __interface_set_down() staticHans Dedecker2018-08-202-2/+1
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* interface: extend interface error messages in interface_set_up()Hans Dedecker2018-08-202-16/+20
| | | | | | | | Don't return an error code in interface_set_up as it's ignored anyway by the calling functions; but rather add more interface error messages so the actual problem is visible for the user by doing ifstatus <interface> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* interface: ensure NO_DEVICE error is always reportedHans Dedecker2018-08-171-2/+2
| | | | | | | | | Remove interface available checks in the functions interface_start_pending and interface_handle_config_change so the NO_DEVICE error is reported in ifstatus <interface> making it clear to the user the configured device in ifname is not found Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* device: gracefully handle device names exceeding IFNAMESIZHans Dedecker2018-08-149-21/+77
| | | | | | | | | | | | Instead of truncating the device name when it exceeds IFNAMSIZ length; let device_set_ifname return an error code and do not add the device to the device list. This avoids possible issues with device names becoming identical due the truncation and as a result unexpected behavior. Further let the different device types gracefully handle the error code returned by device_init Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* interface-ip: always override downstream IPv6 mtuHans Dedecker2018-08-071-2/+5
| | | | | | | | | | Always override the downstream IPv6 mtu in case it differs with the IPv6 mtu of the upstream link. This allows to increase the downstream IPv6 mtu in case RA messages are received on the upstream link having a mtu attribute higher than the downstream IPv6 mtu. At the same be verbose when failing to set the IPv6 mtu on the downstream link. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* fix compile errorJohn Crispin2018-07-301-1/+0
| | | | | | netifd-2018-07-30-75ee7905/interface-ip.c:724:11: error: unused variable 'macaddr' [-Werror=unused-variable] Signed-off-by: John Crispin <john@phrozen.org>
* interface-ip: fix eui64 ifaceid generation (FS#1668)Hans Dedecker2018-07-301-2/+2
| | | | | | | | Use the mac address stored in the device_settings struct to generate the eui64 ifaceid as the interface layer3 device does not contain a mac address for non bridge interfaces Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: make sure the vlan ifname fits into the bufferJohn Crispin2018-07-271-0/+3
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* iprule: remove bogus assert callsFelix Fietkau2018-07-251-3/+0
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* iprule: fix broken in_dev/out_dev checksFelix Fietkau2018-07-251-2/+2
| | | | | | Since they are both char arrays, they can never be NULL Signed-off-by: Felix Fietkau <nbd@nbd.name>
* vlan: use alloca to get rid of IFNAMSIZE in vlan_dev_set_name()Hans Dedecker2018-07-171-2/+4
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* ubus: display correct prefix size for IPv6 prefix addressHans Dedecker2018-07-161-1/+1
| | | | | | | Make sure the displayed prefix size is identical to the kernel installed prefix size for local IPv6 prefix addresses Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* CMakeLists.txt: add -Wimplicit-fallthrough to the compiler flagsAlexander Couzens2018-07-111-1/+1
| | | | | Signed-off-by: Alexander Couzens <lynxis@fe80.eu> Acked-by: Hans Dedecker <dedeckeh@gmail.com>
* proto-shell.c: add a explicit "fall through" comment to make the compiler happyAlexander Couzens2018-07-111-1/+2
| | | | | Signed-off-by: Alexander Couzens <lynxis@fe80.eu> Acked-by: Hans Dedecker <dedeckeh@gmail.com>
* replace fall throughs in switch/cases where possible with simple code changesAlexander Couzens2018-07-113-16/+19
| | | | | | | | fall throughs are usually error-prone, especially when someone else extend it. Signed-off-by: Alexander Couzens <lynxis@fe80.eu> Acked-by: Hans Dedecker <dedeckeh@gmail.com>
* iprule: rework interface based rules to handle dynamic interfacesAlexander Couzens2018-07-052-21/+164
| | | | | | | | | | | | | Previous netifd would only apply `ip rule`s while config phase. If the iprule is depending on an interface (iif or oif), the rule will fail if the interface is not up. Allow iprules to track interfaces and their devices by using the interface events. Fixes: FS#1571 Acked-by: Hans Dedecker <dedeckeh@gmail.com> Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
* Introduce new interface event "create" (IFEV_CREATE)Alexander Couzens2018-07-053-0/+4
| | | | | | | "create" will be called before the proto handlers initialised. Acked-by: Hans Dedecker <dedeckeh@gmail.com> Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
* system-linux: fix build error on older kernelsFelix Fietkau2018-07-041-0/+2
| | | | | | | Add an #ifdef guard around 56000base* definitions, which don't exist on Linux 3.18 Signed-off-by: Felix Fietkau <nbd@nbd.name>
* system-linux: adjust bridge isolate mode for upstream attribute namingFelix Fietkau2018-07-041-3/+3
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* system-linux: extend link mode speed definitionsHans Dedecker2018-07-041-6/+22
| | | | | | Add all available link mode speed definitions as defined in ethtool.h Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* system-linux: add autoneg and link-partner outputJoe Holden2018-06-281-0/+6
| | | | | | | | | | This adds an array that contains the link modes advertised by the other device and also indicates whether auto negotiation is true or false. link-partner may or may not be populated depending on hardware, driver and/or settings. Signed-off-by: Joe Holden <jwh@zorins.co.uk> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* system-linux: make encaplimit configurable for ip6 tunnels (FS#1501)Hans Dedecker2018-05-303-18/+50
| | | | | | | | | | | | | Make encapsulation limit of IP6 tunnels configurable for the ds-lite/map proto shell handlers as not all ISPs support the destination option header containing the tunnel encapsulation limit value as reported in FS#1501. The IP6 tunnel specific setting encaplimit is parsed as a nested json data object; setting it to ignore disables the insertion of the destination option header while a value from 0 till 255 sets the tunnel encapsulation limit accordingly in the destination option header. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* nterface-ip: remove superfluous iface check in interface_ip_set_enabled()Hans Dedecker2018-04-261-1/+1
| | | | | | | | No need to check iface pointer in interface_ip_set_enabled as the interface is always set by the function __interface_ip_init(). Reported by Coverity in CID 1330437 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* system-linux: fix strncpy boundsHans Dedecker2018-04-241-8/+8
| | | | | | | Fix strncpy bounds as reported by Coverity in CID 1434988, 1328977, 1328953, 1328952, 1328951, 1328950, 1328949 and 1328944. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* wireless: include noscan option in common wdev varsDaniel Golle2018-04-201-1/+1
| | | | | | | 'noscan' can be passed down to wpa_supplicant to enforce channel settings in mesh mode. Allow hostapd.sh to take care of it. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* system-linux: check ioctl return value in system_vlan()Hans Dedecker2018-04-161-1/+2
| | | | | | Detected by Coverity in CID 1433754 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* system-linux: check ioctl return value in system_if_flags()Hans Dedecker2018-04-141-1/+3
| | | | | | Detected by Coverity in CID 1433760 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* system-linux: fix segfault on alloc failure in system_if_check()Hans Dedecker2018-04-141-0/+3
| | | | | | Detected by Coverity in CID 1433686 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* system-linux: fix segfault on error in system_add_ip6_tunnel()Hans Dedecker2018-04-141-1/+10
| | | | | | Detected by Coverity in CID 1430884 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* handler: fix resource leak on error in netifd_init_script_handlers()Hans Dedecker2018-04-121-1/+6
| | | | | | Detected by Coverity in CID 1412486 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* system-linux: remove unnecessary open call in system_if_dump_info()Hans Dedecker2018-04-121-7/+2
| | | | Detected by coverity in CID 1329735
* system-linux: fix memory leak on error in system_add_vxlan()Hans Dedecker2018-04-121-2/+4
| | | | | | Detected by coverity in CID 1412449 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* interface-ip: fix memory leak on error in interface_update_prefix_assignments()Hans Dedecker2018-04-121-1/+3
| | | | | | Detected by coverity in CID 141267 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* interface: fix "ifup-failed" hotplug event handlingMartin Schiller2018-04-101-2/+8
| | | | | | | | | | The ifup-failed event should only be triggered when the former interface state is IFS_SETUP. Otherwise, there will also be an ifup-failed event in the IFS_TEARDOWN stateif you do an manual ifdown <IFC>. Signed-off-by: Martin Schiller <ms@dev.tdt.de>
* interface-ip: fix memory leak in interface_ip_add_target_route()Hans Dedecker2018-04-021-16/+16
| | | | | | | | | | Commit 9c8d781 introduced a memory leak in interface_ip_add_target_route in case interface_ip_find_addr_target returns true for a given address by not freeing the previously allocated route. While at it rework the logic so a host route is only allocated when it's really required. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: return the interface for locally addressable host dependencies (FS#1452)Felix Fietkau2018-03-271-3/+2
| | | | | | | | Fixes an issue where interfaces with host dependencies that resolve to a local subnet stay down. Fixes: 1f5a29c3de6e ("ip: do not add local routes for host dependencies") Signed-off-by: Felix Fietkau <nbd@nbd.name>
* interface-ip: fix route selection for host dependenciesFelix Fietkau2018-03-131-1/+1
| | | | | | | | | | In order to find the best match, allow overriding the last found entry if route->mask for the new entry is bigger than the one from the previous entry. Patch submitted by 'Mikael' in FS#1358 Signed-off-by: Felix Fietkau <nbd@nbd.name>
* device: add support for setting the isolate options for bridge portsFelix Fietkau2018-03-133-0/+18
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ip: do not add local routes for host dependenciesFelix Fietkau2018-03-071-2/+1
| | | | | | | 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>
* remove rps/xps configuration supportFelix Fietkau2018-02-264-137/+1
| | | | | | | | 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>
* netifd-proto: add proto_config_add_array wrapperHans Dedecker2018-02-051-0/+4
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>