summaryrefslogtreecommitdiffhomepage
path: root/alias.c
AgeCommit message (Collapse)Author
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-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>
2016-09-26device: Move the different device type registrations to the device type fileHans Dedecker
While at it; make device_types static if only used in the device type file Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-08-26device: prepare for adding device handlers dynamicallyArne Kappen
- remove const from device handler struct - pass device handler type to create function Signed-off-by: Arne Kappen <akappen@inet.tu-berlin.de> Signed-off-by: Felix Fietkau <nbd@nbd.name> [cleanup]
2016-06-29alias: Set alias link device status to disabled when device is removedHans Dedecker
Fixes missing link state event propagation for an aliased device in case a new device is added as the link state has the last known status of the old device possible resulting into no link state change detection. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> Acked-by: Felix Fietkau <nbd@nbd.name>
2016-06-06device: Fix device find failure in avl list due to device name changeHans Dedecker
As device name is used as key in avl list a device name change will break the avl find logic. Function device_set_ifname offers api to set the device name and re-inserts the avl node in the list when the avl key value is changed. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-03-31alias : Fix interface aliased on top of a static interface not getting activeHans Dedecker
An interfaces referring to a static interface is not getting active when doing a network reload or ifup. The problem is triggered by alias_set_device which is not clearing the pending update (mostly a null device due to the previous down event) when the same device is set as the current device via alias_notify_device. As a result alias_set_device_state when called will overwrite the device with an invalid pending device meaning the interface will not be set available anymore and thus will stay down. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-02-01alias: Fix possible segfaultHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-01-28alias: clean up device dependencies on freeFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-02-27netifd: Link layer state awareness support on interface levelHans Dedecker
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>
2013-12-14Revert "netifd: Link layer state support on device level"Felix Fietkau
This reverts commit c439b52400978dd3799c66e1f632ee68d2c7c9eb.
2013-12-08netifd: Link layer state support on device levelHans Dedecker
Patch implements link layer state awareness (aka carrier detection) in netifd on device level. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2013-01-28alias: set ifindex on alias device to fix setting addresses/routesFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-22alias: if the underlying device changes (or goes away), set the device ↵Felix Fietkau
present status to false to make its users shut down Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-20alias: rework device updatesFelix Fietkau
Apply immediately if alias device is not claimed, otherwise defer until release Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-16alias: use layer 3 device instead of main deviceSteven Barth
2012-10-30alias: add (and call) a check_state function to fix dynamically creating ↵Felix Fietkau
aliases for interfaces that are already up Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-10-19fix device_lock/device_unlock imbalancesFelix Fietkau
2012-07-05alias: use a callback for managing device presence state, track alias deps ↵Felix Fietkau
in a separate list to avoid recursion issues
2012-07-05split alias support into a separate source file for better readabilityFelix Fietkau