netifd : Disable netlink auto ack

Disable netlink auto ack when doing a delete in the get callback
handler to avoid race conditions resulting into stalled message
on the netlink socket.

Solves issue reported in https://dev.openwrt.org/ticket/14590

Signed-off-by: Karl Vogel <karl.vogel@gmail.com>
Acked-by: Hans Dedecker <dedeckeh@gmail.com>
netifd : Fix ubus route src mask printing

Fix printing of route src mask attribute when it contains 3 digits

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Fix source-restrictions of routes when no mask was provided
IPv6: work around dangling routes kernel issue
Work around warn_unused_result in recent gcc/libc
add a helper to convert blobmsg types to luci validate rules

Signed-off-by: John Crispin <blogic@openwrt.org>
make netifd_handler_parse_config honour the luci validation passed from the backend scripts

Signed-off-by: John Crispin <blogic@openwrt.org>
get_proto_handlers now also dumps the validation info

Signed-off-by: John Crispin <blogic@openwrt.org>
add validation rules to proto static

Signed-off-by: John Crispin <blogic@openwrt.org>
wireless: load and then ignore disabled devices

Signed-off-by: John Crispin <blogic@openwrt.org>
wireless: add a "get_validate" methode to ubus

Signed-off-by: John Crispin <blogic@openwrt.org>
wireless: fix device config reload regression

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Don't always assume routes & addresses are applied

Actually check netlink return values and remember failure.

Signed-off-by: Steven Barth <steven@midlink.org>
netifd: Link layer state awareness support on device level

Device layer is informed by netlink events regarding the link layer status. Link
layer status change results in a DEV_EVENT_LINK_UP/DEV_EVENT_LINK_DOWN broadcast
event for a given device.

Depends on uloop error callback patch.

Solves issue reported in https://dev.openwrt.org/ticket/14590

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Acked-by: Karl Vogel <karl.vogel@gmail.com>
netifd: Link layer state awareness support on interface level

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>
ubus events: don't incorrectly announce an interface as being up

Signed-off-by: Steven Barth <steven@midlink.org>
wireless: defer init until after command line option processing

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
netifd: fix bridge reloading issue

Check in the right order to decide if the bridge have to be set up.
Additionally we are consistent with setting it down.

Signed-off-by: Emanuel Taube <emanuel.taube@gmail.com>
proto-shell: defer init until after command line option processing

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
netifd: Fix bridge MTU setting when a bridge member is added

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>