summaryrefslogtreecommitdiff
path: root/interface.c
Commit message (Collapse)AuthorAgeFilesLines
...
* interface: minor fix for unnecessary ++ operation.Yousong Zhou2015-05-231-1/+1
| | | | Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
* interface: remove redundant iface_attr_info.Yousong Zhou2015-05-231-6/+0
| | | | | | | | BLOBMSG_TYPE_STRING is the default type for elements of BLOBMSG_TYPE_ARRAY. Array type IFACE_ATTR_DNS_SEARCH was already missing there, so drop the whole part anyway. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
* interface: allow an interface to specify device configs even when there are ↵Felix Fietkau2015-04-191-1/+3
| | | | | | other interfaces attached to the same device Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* netifd: fix an uninitialized variableFelix Fietkau2015-04-191-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* device: add support for removing interface config on reloadFelix Fietkau2015-04-181-5/+15
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* interface: detect and handle changes in device configFelix Fietkau2015-04-181-0/+32
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* netifd: Interface last error supportHans Dedecker2015-04-031-1/+26
| | | | | | | | | | | | | | Adds interface last error support which preserves the last reported error reported by the protocol handler till the interface is up; e.g. survives network reload and interface restarts. This is mainly usefull for tracking down why an interface fails to establish; eg auth failure/traffic limit for PPP interfaces Protocol handlers register last error support by setting lasterror=1 in the proto_init function Signed-off-by: Johan Peeters <johan.peeters111@gmail.com> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd:Make sure interface device config is also cachedHans Dedecker2015-03-191-3/+3
| | | | | | | | | | Fixes issue interface device config is not applied in some cases. As the interface device config was applied but not always cached; an interface device config diff was not always detected. Simplify device config setting by exposing as api only device_apply_config Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* interface: apply device config passed through interface configFelix Fietkau2015-01-241-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* netifd: Make interface identifier of delegated IPv6 address configurableHans Dedecker2015-01-191-0/+35
| | | | | | | | | | | | | The ip6ifaceid UCI interface parameter makes the interface identifier of the delegated IPv6 address configurable. The parameter can have the following values: eui64 : Interface identifier is generated from the interface's MAC address random : Interface identifier is generated randomly fixed value : Interface identifier is a fixed value (eg ::1:2) The latter is the default value with a fixed value of ::1 for backwards compatibility Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> Signed-off-by: Joeri Barbarien <joeri.barbarien@gmail.com>
* netifd: Handle link down event in interface setup state as wellHans Dedecker2014-12-231-0/+1
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Fix interface auto disable when doing network reloadHans Dedecker2014-12-081-2/+6
| | | | | | Keep interface down when interface auto parameter is set to 0 when doing network reload Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd : Reinsert ip parameters (addresses/routes) based on old interface ↵Hans Dedecker2014-10-241-2/+5
| | | | | | | | | | | config state Reinserts the config IP parameters as the config_ip parameter of the new interface is set to false in interface_alloc and thus not loading the config ip options of the old interface Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Fix lost interface device config for devices having default configHans Dedecker2014-10-121-2/+4
| | | | | | | As the PPP main device (either a simple or old style vlan device) is freed when PPP interfaces are reloaded; interface device specific config (eg mtu/macaddr/...) is lost as the interface config is not re-applied on the newly created device. Patch fixes the issue by re-applying the interface device config after the main device is claimed and is having default config. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* interface: call proto teardown before marking the interface as downFelix Fietkau2014-08-311-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* interface: do not try to bring up an unavailable interfaceFelix Fietkau2014-08-311-0/+3
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* interface: cancel the remove timer on cleanupFelix Fietkau2014-08-311-0/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* netifd: Allow to add link devices which can be marked as non externalHans Dedecker2014-07-301-6/+8
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* interface: enable force_link by default for proto=staticFelix Fietkau2014-07-271-1/+4
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* interface: fix restart after reload with external devicesFelix Fietkau2014-07-241-0/+16
| | | | | | | | 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>
* Make dynamic interfaces always autostartSteven Barth2014-07-231-0/+1
| | | | Signed-off-by: Steven Barth <steven@midlink.org>
* interface: clean up l3 device reference on remove/reloadFelix Fietkau2014-06-291-2/+2
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* interface: fix indentationFelix Fietkau2014-06-261-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* netifd: Check device_claim return code in all casesHans Dedecker2014-06-181-4/+8
| | | | | | Fixes observed issue a tunnel interface is reported as up although device_claim failed Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* Fix a spurious segfault when tearing down interfacesSteven Barth2014-05-211-1/+1
| | | | Signed-off-by: Steven Barth <steven@midlink.org>
* netifd: Check interface state only when main device is set during ↵Hans Dedecker2014-05-091-1/+2
| | | | | | | | | | 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>
* interface: clear iface->available before changing main_devFelix Fietkau2014-05-021-0/+1
| | | | | | Fixes bogus interface restart loop on interface_remove_link Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* interface: use interface_set_main_dev() from interface_remove_linkFelix Fietkau2014-05-021-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* interface: do not set l3_dev along with main_dev anymoreFelix Fietkau2014-05-021-4/+0
| | | | | | Made unnecessary by recent fixes to l3_dev handling Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* interface: ensure that l3_dev gets set whenever the proto handler marks the ↵Felix Fietkau2014-04-191-0/+3
| | | | | | interface as up Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* interface: add support for a parameter to force setup without a carrier on ↵Felix Fietkau2014-04-111-2/+9
| | | | | | the underlying device Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* interface: always delete l3 dev on proto downFelix Fietkau2014-04-051-0/+2
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* netifd: Reload proto on topology changeHelmut Schaa2014-03-211-0/+5
| | | | | | | | | | Introduce a new device event "topology change" that gets signaled by bridges on adding/removing members. On "topology changes" the proto handlers are requested to "renew" which is most useful for DHCP. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
* netifd: Check interface autostart parameter when handling interface state ↵Hans Dedecker2014-03-201-1/+1
| | | | | | | | changes Fixes an issue when 2 interfaces make use of the same ifname (device) and one of the interfaces has autostart disabled; bringing up the other interface would also start the interface for which autostart is disabled (link_state and enabled will both be true for the autostart disabled interface and thus a setup will be launched) Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Set interface state in teardown state before launching an interface ↵Hans Dedecker2014-03-111-2/+5
| | | | | | | | event Interface state needs to be set in teardown state before launching an interface event otherwise the up state will be reported as true in the ubus interface notify message Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Fix bridge MTU setting when a bridge member is addedHans Dedecker2014-03-111-1/+1
| | | | | | Reapply bridge mtu setting as adding a bridge member will override the bridge mtu in the kernel Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Link layer state awareness support on interface levelHans Dedecker2014-02-271-30/+100
| | | | | | | | The link layer state is monitored for a given interface; an interface will be setup when both enabled and link layer active. Likewise an interface will be teared down when either disabled or link layer down. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* Remove automatically assigned IPv6 routing tableSteven Barth2014-01-171-8/+0
| | | | | This puts IPv6 routes back into the main table where they are expected. Instead the newly-fixed source-address restrictions should be used.
* Add indicator-flags to ubus and hotplug update-eventsSteven Barth2014-01-171-5/+14
|
* Revert "netifd: Link layer state support on interface level"Felix Fietkau2013-12-141-100/+30
| | | | This reverts commit 7335c3e19ea09674245dda3653d3f40705e68d6b.
* netifd: Link layer state support on interface levelHans Dedecker2013-12-081-30/+100
| | | | | | | | | | | Patch implements handling of link layer support on interface level. An interface will go into the setup state when it's enabled and the underlying link state is enabled. Vice versa an interface will go to the down state when it's either disabled or underlying link state is disabled. Testing has been done with PPP, IPoE, tunnel and static interfaces Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Code style line/clean upHans Dedecker2013-12-081-1/+1
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* add helper function for adding/removing devices to interfacesFelix Fietkau2013-10-221-0/+31
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* interface: rework code to get rid of arbitrary IFNAMSIZ limitation for ↵Felix Fietkau2013-10-191-4/+7
| | | | | | interface names Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* interface: remove "dynamic" argument for interface_init, add the ↵Felix Fietkau2013-10-191-4/+6
| | | | | | interface_set_dynamic function instead Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* Add option "delegate" to toggle prefix delegationSteven Barth2013-10-181-0/+4
|
* key to data elements point at wrong memory areaSteven Barth2013-10-171-1/+1
|
* Add protocol update notifications and hotplug legacy callsSteven Barth2013-10-171-1/+4
|
* Add ubus function to create nested interfacesSteven Barth2013-10-171-1/+8
|
* interface: fix NULL pointer defref in interface_set_main_devFelix Fietkau2013-06-181-0/+3
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>