summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2014-08-07netifd: More fine grained handling of unwanted proto shell actionsHans Dedecker
In commit e1ec2d2b9e7f7692a4ff88a0361bbcdbe34f0d99 (proto-shell: extend race condition avoidance), changes were made to prevent notifications from the proto handler during the proto shell states teardown and abort. These changes unfortunately also prevent netifd from being notified of a number of proto handler events like notify_error, blok_restart and kill during the teardown state. This introduces issues when the protocol is ppp, the authfail UCI parameter is set and authentication fails; the interface autostart parameter cannot be set to disabled while the ppp daemon keeps running as these proto handler notifications are dropped in the teardown state. The attached patch blocks the notifications in the individual notification handlers which should not get notifications during teardown/abort state and allows notify_error/blok_restart/kill notifications during these states. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2014-08-06Disable new-style tunnel creation for older kernelsSteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2014-08-05netifd: Accept notify errors in proto_shell teardown or abort stateHans Dedecker
In commit e1ec2d2b9e7f7692a4ff88a0361bbcdbe34f0d99 (proto-shell: extend race condition avoidance), changes were made to prevent notifications from the proto handler during teardown. According to the comments, this was done to avoid the shell proto state being reset to S_IDLE and the interface hanging in IFS_TEARDOWN state. These changes unfortunately also prevent netifd from being notified of the errors (proto_shell_notify_error) that actually caused the teardown. This is for instance an issue when the protocol is ppp and e.g. PAP/CHAP authentication fails. Since proto_shell_notify_error does not touch the proto state, it seems like a good idea to at least allow these notifications in teardown state. The attached patch accomplishes this. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> Signed-off-by: Joeri Barbarien <joeri.barbarien@gmail.com>
2014-08-05netifd: fix incorrect number of bytes memset in clear_if_addrHans Dedecker
Fix clear_if_addr for IPv6 addresses as an incorrect number of bytes were memset due to wrong sizeof argument Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2014-07-30netifd: GRE tunnel supportHans Dedecker
Adds support for gre, gretap, grev6 and grev6tap tunnels Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2014-07-30netifd: Allow to add link devices which can be marked as non externalHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2014-07-30netifd: Set device down based on being a non external device in device_releaseHans Dedecker
Line up the device state manipulation by checking the external device parameter consistent and not the hotplug device parameter Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2014-07-29add_dynamic: remove redundant codeSteven Barth
device_config is unneeded since add_dynamic is used to create aliases checking of setup state is unneeded because of race condition fixes Signed-off-by: Steven Barth <steven@midlink.org>
2014-07-29proto-shell: extend race condition avoidanceSteven Barth
Disallow all notifications from the proto handler during teardown to avoid the shell proto state being reset to S_IDLE and the interface hanging in IFS_TEARDOWN state. Signed-off-by: Steven Barth <steven@midlink.org>
2014-07-28ubus: add del_dynamic as complement to add_dynamicSteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2014-07-27interface: enable force_link by default for proto=staticFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-07-26proto-shell: fix renew_pending handlingFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-07-26proto-shell: fix setup/renew race conditionFelix Fietkau
If a renew event arrives before the setup event has been processed, the renew event needs to be deferred, otherwise interfaces can get stuck Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-07-25Only add dynamic interfaces if the underlying interface is readySteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2014-07-24proto-shell: don't accept up-notifications in teardown stateSteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2014-07-24interface: fix restart after reload with external devicesFelix Fietkau
When an interface goes down, the main_dev is reset to NULL. Track an externally added device separately to be able to bring it back up. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-07-24bridge: enable multicast querier functionality by defaultFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-07-23Set DEVICE for legacy ifupdate event as wellSteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2014-07-23Make dynamic interfaces always autostartSteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2014-07-18scripts: set type for the "key" attributeFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-07-17bridge: enable IGMP snooping by defaultFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-06-29interface: clean up l3 device reference on remove/reloadFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-06-29bridge: enable multicast_to_unicast on all wireless bridge portsFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-06-26device: fall back to simple interface status check if not provided by the ↵Felix Fietkau
device type Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-06-26interface: fix indentationFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-06-26proto-shell: add debug msg for calling handlersFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-06-26system-dummy: set present flags on all devicesFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-06-20interface: don't store table id in route if the default table is usedSteven Barth
Use system_is_default_rt_table() to test whether the resolved routing table is the default one, in this case do not apply the table attribute to the route object. This is needed for backwards compatibility - only routes using a non-default table shall report it in the ifstatus output. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-06-20system: fix treatment of RT_TABLE_MAINSteven Barth
Do not treat RT_TABLE_MAIN as RT_TABLE_UNSPEC in system_resolve_rt_table() in order to allow ip rules with lookup main to work as expected. Provide a new function system_is_default_rt_table() to allow calling code to specifically test for RT_TABLE_MAIN, this is going to be needed for the backwards compatible handling of the table attribute in route objects. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-06-18linux: unify functions to delete linksSteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2014-06-18netifd: Route type supportHans Dedecker
Patch adds route type support in netifd by means of the route parameter type. By default the route type was unicast; the parameter adss support for local/broadcast/multicast/unicast routes which will be put into the appropriate routing table. If route type parameter is unset the route type will be unicast as before. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2014-06-18netifd: Check device_claim return code in all casesHans Dedecker
Fixes observed issue a tunnel interface is reported as up although device_claim failed Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2014-06-18netifd: Fix ipip6 tunnel memleak in case of tunnel creation failureHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2014-06-18netifd: Fix macvlan delete via netlinkHans Dedecker
Fix macvlan delete via netlink as netlink attribute IFLA_IFNAME data size was incorrect (size reject by the kernel) and NLM_F_REQUEST flag was missing. In addition some minor improvements (attribute IFLA_INFO_KIND can be left out as RTM_DELLINK does not require the attribute) Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2014-06-18netifd: Fix vlan delete via netlinkHans Dedecker
Fix vlan delete via netlink as netlink attribute IFLA_IFNAME data size was incorrect. In addition some minor improvements. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2014-06-11Reorder alfabetically device type matching as they are growing in numberGioacchino Mazzurco
Signed-off-by: Gioacchino Mazzurco <gmazzurco89@gmail.com>
2014-06-11Add vlan 802.1q/802.1ad support as netifd devicesGioacchino Mazzurco
At moment netifd supports just 802.1q vlan, you can configure them using a concise but "hacky" syntax using an interface config section, with this patch netifd acquire the capability of configuring 802.1ad and 802.1q vlan using config device sections, so you can define a vlan device plus interface with something like this: config device 'test' option type '8021ad' option name 'test' option ifname 'eth0' option vid '1000' config interface 'testif' option ifname 'test' option proto 'none' option auto '1' old syntax for 802.1q keeps working so no retrocompatibility problems, to keep retrocompatibility means also that user must not use name/ifname like eth0.2 for devices declared with the new style because this would trigger the "old style" when interface config section is parsed Signed-off-by: Gioacchino Mazzurco <gmazzurco89@gmail.com>
2014-06-11Add qtcreator and kdevelop4 project files to .gitignoreGioacchino Mazzurco
Signed-off-by: Gioacchino Mazzurco <gmazzurco89@gmail.com>
2014-06-11netifd: process reload calls immediately instead of going through a timerFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-06-10Add support for onlink-flags for IPv4 routesSteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2014-06-05add a interface. prefix to ubus_notify callsJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2014-05-28macvlan: fix missing reference to device_attr_listGioacchino Mazzurco
At moment macvlan devices ignore options inherited as device like mtu. Thanks to suggestions provided by Felix i have done this patch that fix this iussue by adding the missing reference to device_attr_list in macvlan_attr_list Signed-off-by: Gioacchino Mazzurco <gmazzurco89@gmail.com>
2014-05-21Rewrite ipip6-tunnel setup to use netlink and add support for FMRsSteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2014-05-21Fix a spurious segfault when tearing down interfacesSteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2014-05-15wireless: fix cancelling setupFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-05-10system-linux: always set the ifindex for hotplug devices on initFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-05-09netifd: Fix node version set after freeHans Dedecker
Fixes an issue where a bridge member will be removed from the bridge upon an interface ifup as the bridge node version -1 is overwritten by vlist_add while the new created bridge member pointer is freed in bridge_member_update Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2014-05-09netifd: Check interface state only when main device is set during ↵Hans Dedecker
interface_change_config Fixes a regression issue introduced by commit d2a33f3f0fe704e4396fa2ada08401cb955ba7cb for device less protocol handlers. An active interface using a deviceless protocol handler will be be teared down when the interface config is checked upon an update as the interface link and enabled parameters are unset as no underlying device is present (eg tunnel interfaces) Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2014-05-09netifd: Effectively apply configured route mtuHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2014-05-09netifd: Remove useless route table parameter check in update_proto_routeHans Dedecker
Not necessary since route table parameter is used as key element in route_cmp Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>