summaryrefslogtreecommitdiff
path: root/macvlan.c
Commit message (Collapse)AuthorAgeFilesLines
* config: parse default mac address from board.jsonFelix Fietkau2020-11-301-5/+0
| | | | | | | | | | | | | Example: { "network-device": { "eth0": { "macaddr": "bc:a5:11:16:76:d7" } } } Signed-off-by: Felix Fietkau <nbd@nbd.name>
* device: gracefully handle device names exceeding IFNAMESIZHans Dedecker2018-08-141-1/+6
| | | | | | | | | | | | 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>
* macvlan: Use macvlan as device type nameHans Dedecker2016-09-261-1/+1
| | | | | | Fixes creation of macvlan devices by UCI due to device handlers rework Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* device: Move the different device type registrations to the device type fileHans Dedecker2016-09-261-1/+6
| | | | | | While at it; make device_types static if only used in the device type file Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* device: prepare for adding device handlers dynamicallyArne Kappen2016-08-261-3/+4
| | | | | | | | - 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]
* device: Don't process link events anymore in device user specific callback ↵Hans Dedecker2015-11-041-8/+0
| | | | | | | | | | | | | | | handlers Set link_state for all device types via the device_set_link API as all devices are registered in the device tree list making it possible to always get the device via device_get. The decice link state parameter will now actually reflect the corresponding kernel device carrier state in all cases. Before this change a vlan/macvlan device could still have link_state enabled if an interface was brought down; this was the case when the parent vlan/macvlan device was still enabled as the netlink link_state event would be dropped for vlan/macvlan devices due to keep_link_state in the function cb_rtnl_event. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Keep reference to a config copy in device type specific reload ↵Hans Dedecker2015-02-171-0/+3
| | | | | | | | | handler as the original config pointer might go stale Fixes random observed crashes in blobmsg_parse when device type specific config data is parsed. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* device: make link status detection optional for vlan devicesFelix Fietkau2014-10-201-0/+1
| | | | | | | Fixes a race condition that triggers endless link loss / detect calls when VLAN devices are created. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* macvlan: fix missing reference to device_attr_listGioacchino Mazzurco2014-05-281-0/+3
| | | | | | | | | | 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>
* netifd: Link layer state awareness support on interface levelHans Dedecker2014-02-271-0/+6
| | | | | | | | 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>
* Revert "netifd: Link layer state support on device level"Felix Fietkau2013-12-141-6/+0
| | | | This reverts commit c439b52400978dd3799c66e1f632ee68d2c7c9eb.
* netifd: Link layer state support on device levelHans Dedecker2013-12-081-0/+6
| | | | | | | Patch implements link layer state awareness (aka carrier detection) in netifd on device level. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* macvlan: turns out netinet/ether.h is needed on some linux systemsFelix Fietkau2013-10-071-0/+4
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* macvlan: include net/ethernet.h instead of netinet/ether.h (more portable)Felix Fietkau2013-10-041-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* device: add macvlan supportFelix Fietkau2013-10-031-0/+254
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>