Age | Commit message (Collapse) | Author |
|
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>
|
|
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>
|
|
While at it; make device_types static if only used in the device type file
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
- 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]
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
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>
|
|
This reverts commit c439b52400978dd3799c66e1f632ee68d2c7c9eb.
|
|
Patch implements link layer state awareness (aka carrier detection) in
netifd on device level.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
present status to false to make its users shut down
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Apply immediately if alias device is not claimed, otherwise defer until release
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
|
|
aliases for interfaces that are already up
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
|
|
in a separate list to avoid recursion issues
|
|
|