summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2018-11-26interface: fix return code of __interface_add()Hans Dedecker
For dynamic interfaces don't return false if vlist_find returns NULL as the calling function will try to free iface in case of an error which has already been freed in interface_change_config() Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-11-26netifd: fix resource leak on error in netifd_add_dynamic()Hans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-11-26config: fix resource leaks on error in config_parse_interface()Hans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-11-26interface: fix memory leak on error in __interface_add()Hans Dedecker
Detected by Coverity in cid 1441495 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-11-19treewide: switch to C-code style commentsHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-11-19treewide: make some functions staticHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-11-16interface: fix removal of dynamic interfacesHans Dedecker
Set config state to remove for dynamic interfaces in the following cases : -interface is set as not available -interface is set as down -interface is set as having no link state This will trigger an interface delete upon the next call of interface_handle_config_change Before this change you could end up with lingering inactive dynamic interfaces in case the aliased interface went down as before a dynamic interface was only removed when set down via ubus Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-11-13interface: rework code to get rid of interface_set_dynamicHans Dedecker
Integrate dynamic interface creation code into interface_alloc and __interface_add so we can get rid of interface_set_dynamic Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-10-17system-linux: enable by default ignore encaplimit for grev6 tunnelsHans Dedecker
Similar as for ip6 tunnels ignore encaplimit by default as not all ISPs support the destination option header containing the tunnel encapsulation limit resulting into broken connectivity Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-10-16system-linux: fix a typo in gre tunnel data parsing logicHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-10-12wireless: Add WPA-EAP-SUITE-B-192 (WPA3-Enterprise)Hauke Mehrtens
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2018-10-12wireless: Add Opportunistic Wireless Encryption (OWE)Hauke Mehrtens
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2018-10-12wireless: Add Simultaneous Authentication of Equals (SAE)Hauke Mehrtens
This adds PSK3 / SAE support. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2018-10-01iprule: coding style fixesHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-10-01iprule: fix segfault (FS#1875)Hans Dedecker
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>
2018-09-19scripts: fix previous commitJo-Philipp Wich
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>
2018-09-19netifd: fix wpa mixed mode matchingRick Farina (Zero_Chaos)
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>
2018-09-18system-linux: enable by default ignore encaplimit for ip6 tunnelsHans Dedecker
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>
2018-09-11CMakeList: Check that compiler supports -Wimplicit-fallthroughFlorian Fainelli
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>
2018-08-20interface: let interface_set_down() return voidHans Dedecker
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>
2018-08-20interface: make __interface_set_down() staticHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-08-20interface: extend interface error messages in interface_set_up()Hans Dedecker
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>
2018-08-17interface: ensure NO_DEVICE error is always reportedHans Dedecker
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>
2018-08-14device: gracefully handle device names exceeding IFNAMESIZHans Dedecker
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>
2018-08-07interface-ip: always override downstream IPv6 mtuHans Dedecker
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>
2018-07-30fix compile errorJohn Crispin
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>
2018-07-30interface-ip: fix eui64 ifaceid generation (FS#1668)Hans Dedecker
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>
2018-07-27netifd: make sure the vlan ifname fits into the bufferJohn Crispin
Signed-off-by: John Crispin <john@phrozen.org>
2018-07-25iprule: remove bogus assert callsFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-07-25iprule: fix broken in_dev/out_dev checksFelix Fietkau
Since they are both char arrays, they can never be NULL Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-07-17vlan: use alloca to get rid of IFNAMSIZE in vlan_dev_set_name()Hans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-07-16ubus: display correct prefix size for IPv6 prefix addressHans Dedecker
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>
2018-07-11CMakeLists.txt: add -Wimplicit-fallthrough to the compiler flagsAlexander Couzens
Signed-off-by: Alexander Couzens <lynxis@fe80.eu> Acked-by: Hans Dedecker <dedeckeh@gmail.com>
2018-07-11proto-shell.c: add a explicit "fall through" comment to make the compiler happyAlexander Couzens
Signed-off-by: Alexander Couzens <lynxis@fe80.eu> Acked-by: Hans Dedecker <dedeckeh@gmail.com>
2018-07-11replace fall throughs in switch/cases where possible with simple code changesAlexander Couzens
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>
2018-07-05iprule: rework interface based rules to handle dynamic interfacesAlexander Couzens
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>
2018-07-05Introduce new interface event "create" (IFEV_CREATE)Alexander Couzens
"create" will be called before the proto handlers initialised. Acked-by: Hans Dedecker <dedeckeh@gmail.com> Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2018-07-04system-linux: fix build error on older kernelsFelix Fietkau
Add an #ifdef guard around 56000base* definitions, which don't exist on Linux 3.18 Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-07-04system-linux: adjust bridge isolate mode for upstream attribute namingFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-07-04system-linux: extend link mode speed definitionsHans Dedecker
Add all available link mode speed definitions as defined in ethtool.h Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-06-28system-linux: add autoneg and link-partner outputJoe Holden
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>
2018-05-30system-linux: make encaplimit configurable for ip6 tunnels (FS#1501)Hans Dedecker
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>
2018-04-26nterface-ip: remove superfluous iface check in interface_ip_set_enabled()Hans Dedecker
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>
2018-04-24system-linux: fix strncpy boundsHans Dedecker
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>
2018-04-20wireless: include noscan option in common wdev varsDaniel Golle
'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>
2018-04-16system-linux: check ioctl return value in system_vlan()Hans Dedecker
Detected by Coverity in CID 1433754 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-04-14system-linux: check ioctl return value in system_if_flags()Hans Dedecker
Detected by Coverity in CID 1433760 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-04-14system-linux: fix segfault on alloc failure in system_if_check()Hans Dedecker
Detected by Coverity in CID 1433686 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-04-14system-linux: fix segfault on error in system_add_ip6_tunnel()Hans Dedecker
Detected by Coverity in CID 1430884 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-04-12handler: fix resource leak on error in netifd_init_script_handlers()Hans Dedecker
Detected by Coverity in CID 1412486 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>