project/netifd.git
11 years agoalias: rework device updates
Felix Fietkau [Sun, 20 Jan 2013 15:45:59 +0000 (16:45 +0100)]
alias: rework device updates

Apply immediately if alias device is not claimed, otherwise defer until release

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
11 years agoalias: use layer 3 device instead of main device
Steven Barth [Wed, 16 Jan 2013 13:56:10 +0000 (14:56 +0100)]
alias: use layer 3 device instead of main device

11 years agoFix a race-condition in prefix-assignment
Steven Barth [Tue, 15 Jan 2013 12:19:34 +0000 (13:19 +0100)]
Fix a race-condition in prefix-assignment

11 years agointerface-ip: use calloc_a to get rid of an extra allocation
Felix Fietkau [Tue, 15 Jan 2013 10:08:19 +0000 (11:08 +0100)]
interface-ip: use calloc_a to get rid of an extra allocation

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
11 years agointerface-ip: replace prefix_assignment_cmp with avl_strcmp
Felix Fietkau [Tue, 15 Jan 2013 10:00:23 +0000 (11:00 +0100)]
interface-ip: replace prefix_assignment_cmp with avl_strcmp

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
11 years agoremove commented out TODO items
Felix Fietkau [Tue, 15 Jan 2013 09:57:14 +0000 (10:57 +0100)]
remove commented out TODO items

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
11 years agoInitial IPv6 prefix support
Steven Barth [Tue, 8 Jan 2013 17:52:32 +0000 (18:52 +0100)]
Initial IPv6 prefix support

Signed-off-by: Steven Barth <steven@midlink.org>
11 years agoadd mac os x compat #define for in6_addr s6_addr32
Felix Fietkau [Tue, 15 Jan 2013 09:54:37 +0000 (10:54 +0100)]
add mac os x compat #define for in6_addr s6_addr32

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
11 years agosystem-linux.c: use uin64_t datatype to read and store interface statistics, pass...
Jo-Philipp Wich [Sun, 13 Jan 2013 19:34:36 +0000 (20:34 +0100)]
system-linux.c: use uin64_t datatype to read and store interface statistics, pass values as u64 blob type

11 years agofix removal of unknown device
Nathan Hintz [Sun, 6 Jan 2013 02:41:45 +0000 (18:41 -0800)]
fix removal of unknown device

Netifd will crash if an attempt is made to remove a device that is not
known to netifd.  For instance:

  ubus call network.interface.lan remove_device "{ \"name\": \"xxx\" }"

Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
11 years agoproto-shell: use calloc_a
Felix Fietkau [Sat, 5 Jan 2013 15:13:29 +0000 (16:13 +0100)]
proto-shell: use calloc_a

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
11 years agoutils.h: get rid of the duplicate BUILD_BUG_ON definition, use the one from libubox
Felix Fietkau [Sat, 5 Jan 2013 14:48:57 +0000 (15:48 +0100)]
utils.h: get rid of the duplicate BUILD_BUG_ON definition, use the one from libubox

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
11 years agouse calloc_a for interface error allocations
Felix Fietkau [Mon, 31 Dec 2012 15:36:01 +0000 (16:36 +0100)]
use calloc_a for interface error allocations

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
11 years agointerface: do not clear errors after an interface is marked as down, the user might...
Felix Fietkau [Mon, 31 Dec 2012 15:35:13 +0000 (16:35 +0100)]
interface: do not clear errors after an interface is marked as down, the user might like to read them

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
11 years agolog: fix processing of incomplete lines
Felix Fietkau [Sat, 29 Dec 2012 17:54:54 +0000 (18:54 +0100)]
log: fix processing of incomplete lines

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
12 years agoduplicate error subsystem and code for interface errors to prevent accessing stale...
Felix Fietkau [Mon, 17 Dec 2012 22:22:46 +0000 (23:22 +0100)]
duplicate error subsystem and code for interface errors to prevent accessing stale data

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
12 years agonetifd: stop using jshn_append
Felix Fietkau [Mon, 17 Dec 2012 14:55:45 +0000 (15:55 +0100)]
netifd: stop using jshn_append

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
12 years agorewrite resolv.conf after any interface state change (not just up)
Felix Fietkau [Thu, 13 Dec 2012 16:13:43 +0000 (17:13 +0100)]
rewrite resolv.conf after any interface state change (not just up)

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
12 years agorewrite resolv.conf after interface up setting updates
Felix Fietkau [Wed, 5 Dec 2012 13:26:09 +0000 (14:26 +0100)]
rewrite resolv.conf after interface up setting updates

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
12 years agofix error checking of asprintf
Frank Meerkötter [Mon, 3 Dec 2012 18:29:16 +0000 (19:29 +0100)]
fix error checking of asprintf

see man asprintf
  [...]
  RETURN VALUE
   When  successful, these  functions return the number of bytes printed, just like sprintf(3).
   If memory allocation wasn't possible, or some other error occurs, these functions will return -1,
   and the contents of strp is undefined.

Signed-off-by: Frank Meerkötter <frank@meerkoetter.org>
12 years agoalias: add (and call) a check_state function to fix dynamically creating aliases...
Felix Fietkau [Tue, 30 Oct 2012 00:21:35 +0000 (01:21 +0100)]
alias: add (and call) a check_state function to fix dynamically creating aliases for interfaces that are already up

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
12 years agofix container_of for the log ustream
Felix Fietkau [Tue, 30 Oct 2012 00:13:17 +0000 (01:13 +0100)]
fix container_of for the log ustream

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
12 years agomove uloop_process_delete call to get rid of an unnecessary check
Felix Fietkau [Tue, 30 Oct 2012 00:12:35 +0000 (01:12 +0100)]
move uloop_process_delete call to get rid of an unnecessary check

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
12 years agoproto-shell: ensure that the teardown timeout gets killed
Felix Fietkau [Mon, 29 Oct 2012 23:50:47 +0000 (00:50 +0100)]
proto-shell: ensure that the teardown timeout gets killed

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
12 years agolog: the ustream notify_state callback is now optional, remove the stub
Felix Fietkau [Mon, 29 Oct 2012 23:03:47 +0000 (00:03 +0100)]
log: the ustream notify_state callback is now optional, remove the stub

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
12 years agouse ustream for process message logging
Felix Fietkau [Mon, 29 Oct 2012 22:55:14 +0000 (23:55 +0100)]
use ustream for process message logging

12 years agouse FD_CLOEXEC instead of tracking lists of fds
Felix Fietkau [Mon, 29 Oct 2012 22:08:01 +0000 (23:08 +0100)]
use FD_CLOEXEC instead of tracking lists of fds

12 years agobridge: toggle device present state after freeing a bridge member to ensure that...
Felix Fietkau [Fri, 19 Oct 2012 13:49:46 +0000 (15:49 +0200)]
bridge: toggle device present state after freeing a bridge member to ensure that it can be reassigned to a different bridge

12 years agofree unused devices after cleaning up interfaces to get rid of recently-freed bridge...
Felix Fietkau [Fri, 19 Oct 2012 13:49:21 +0000 (15:49 +0200)]
free unused devices after cleaning up interfaces to get rid of recently-freed bridge devices

12 years agofix device_lock/device_unlock imbalances
Felix Fietkau [Fri, 19 Oct 2012 13:48:52 +0000 (15:48 +0200)]
fix device_lock/device_unlock imbalances

12 years agosystem-linux: do not delete kernel-generated ipv6 routes to fix using advertised...
Felix Fietkau [Fri, 28 Sep 2012 23:07:59 +0000 (01:07 +0200)]
system-linux: do not delete kernel-generated ipv6 routes to fix using advertised routes

12 years agodevice.c: use format_macaddr() helper to convert mac addresses to strings, ether_ntoa...
Jo-Philipp Wich [Fri, 28 Sep 2012 15:41:08 +0000 (17:41 +0200)]
device.c: use format_macaddr() helper to convert mac addresses to strings, ether_ntoa() does not guarantee a canonical format

12 years agoutils.c: add helper function to format mac addresses as strings
Jo-Philipp Wich [Fri, 28 Sep 2012 15:40:38 +0000 (17:40 +0200)]
utils.c: add helper function to format mac addresses as strings

12 years agoubus.c: now that disabled routes are in the inactive subtable it makes no sense to...
Jo-Philipp Wich [Thu, 13 Sep 2012 07:24:12 +0000 (10:24 +0300)]
ubus.c: now that disabled routes are in the inactive subtable it makes no sense to expose the enabled attribute anymore

12 years agoubus.c: move disabled routes, ips, dns server into an "inactive" subtable
Jo-Philipp Wich [Thu, 13 Sep 2012 06:57:16 +0000 (09:57 +0300)]
ubus.c: move disabled routes, ips, dns server into an "inactive" subtable

12 years agointerface-ip.c: fix possible null pointer access if calloc() fails
Jo-Philipp Wich [Thu, 13 Sep 2012 06:56:14 +0000 (09:56 +0300)]
interface-ip.c: fix possible null pointer access if calloc() fails

12 years agoadd optional flag for disabling compiler optimization (debug only)
Felix Fietkau [Thu, 6 Sep 2012 14:54:16 +0000 (16:54 +0200)]
add optional flag for disabling compiler optimization (debug only)

12 years agodo not prematurely release the main dev on link loss, should fix DHCP NAK handling
Felix Fietkau [Thu, 6 Sep 2012 14:53:50 +0000 (16:53 +0200)]
do not prematurely release the main dev on link loss, should fix DHCP NAK handling

12 years agoclean up and fix system-dummy addr/route messages
Felix Fietkau [Thu, 6 Sep 2012 10:57:20 +0000 (12:57 +0200)]
clean up and fix system-dummy addr/route messages

12 years agosystem-linux.c: install user routes with RTPROT_STATIC instead of RTPROT_BOOT so...
Jo-Philipp Wich [Sat, 11 Aug 2012 16:01:28 +0000 (18:01 +0200)]
system-linux.c: install user routes with RTPROT_STATIC instead of RTPROT_BOOT so that routing daemons like quagga will pick it up

12 years agodo not recreate or restart external devices on settings changes, apply them at runtime
Felix Fietkau [Thu, 12 Jul 2012 21:48:29 +0000 (23:48 +0200)]
do not recreate or restart external devices on settings changes, apply them at runtime

12 years agoapply basic device settings for hotplug devices, e.g. mtu and txqueuelen
Felix Fietkau [Thu, 12 Jul 2012 21:46:32 +0000 (23:46 +0200)]
apply basic device settings for hotplug devices, e.g. mtu and txqueuelen

12 years agoadd simple device config params to interface blob attributes, and add a flag that...
Felix Fietkau [Thu, 12 Jul 2012 21:28:22 +0000 (23:28 +0200)]
add simple device config params to interface blob attributes, and add a flag that indicates if it is present

12 years agoexpose system_if_apply_settings, make it ignore the mac address for external devices
Felix Fietkau [Thu, 12 Jul 2012 21:25:21 +0000 (23:25 +0200)]
expose system_if_apply_settings, make it ignore the mac address for external devices

12 years agoensure hotplug devices are marked as present in the add path - they are not cleaned...
Felix Fietkau [Thu, 12 Jul 2012 21:20:38 +0000 (23:20 +0200)]
ensure hotplug devices are marked as present in the add path - they are not cleaned up if they have config settings attached to them

12 years agofix device_lock/device_unlock imbalance in the hotplug device handling
Felix Fietkau [Thu, 12 Jul 2012 21:20:01 +0000 (23:20 +0200)]
fix device_lock/device_unlock imbalance in the hotplug device handling

12 years agoadd some debug messages for device user count
Felix Fietkau [Thu, 12 Jul 2012 21:17:38 +0000 (23:17 +0200)]
add some debug messages for device user count

12 years agosystem-linux.c: fix sysctl setting
Jo-Philipp Wich [Wed, 11 Jul 2012 18:22:42 +0000 (20:22 +0200)]
system-linux.c: fix sysctl setting

The system_set_dev_sysctl() function erroneously used the value instead of the
device name to format the sysctl path, this change corrects that.

12 years agowhen specifying hotplug devices that already have existing configured devices, set...
Felix Fietkau [Thu, 5 Jul 2012 18:32:07 +0000 (20:32 +0200)]
when specifying hotplug devices that already have existing configured devices, set the external flag

12 years agoavoid setting device presence for wifi interfaces via hotplug messages
Felix Fietkau [Thu, 5 Jul 2012 18:30:46 +0000 (20:30 +0200)]
avoid setting device presence for wifi interfaces via hotplug messages

12 years agoalias: use a callback for managing device presence state, track alias deps in a separ...
Felix Fietkau [Thu, 5 Jul 2012 18:28:31 +0000 (20:28 +0200)]
alias: use a callback for managing device presence state, track alias deps in a separate list to avoid recursion issues

12 years agosplit alias support into a separate source file for better readability
Felix Fietkau [Thu, 5 Jul 2012 17:58:46 +0000 (19:58 +0200)]
split alias support into a separate source file for better readability

12 years agozero-initialize the ifreq when adding/removing bridge member interfaces
Felix Fietkau [Thu, 5 Jul 2012 16:17:46 +0000 (18:17 +0200)]
zero-initialize the ifreq when adding/removing bridge member interfaces

12 years agozero-initialize the ifreq when setting interfaces up or down
Felix Fietkau [Thu, 5 Jul 2012 16:16:31 +0000 (18:16 +0200)]
zero-initialize the ifreq when setting interfaces up or down

12 years agomemset the on-stack device route when clearing local subnet routes
Felix Fietkau [Thu, 5 Jul 2012 16:15:09 +0000 (18:15 +0200)]
memset the on-stack device route when clearing local subnet routes

12 years agomake alias devices attach to interface l2 devs
Felix Fietkau [Thu, 5 Jul 2012 12:33:04 +0000 (14:33 +0200)]
make alias devices attach to interface l2 devs

12 years agofix ifname for alias+vlan chains
Felix Fietkau [Thu, 5 Jul 2012 12:18:04 +0000 (14:18 +0200)]
fix ifname for alias+vlan chains

12 years agomake vlan devices virtual to avoid avl tree issues with changing ifnames when bound...
Felix Fietkau [Thu, 5 Jul 2012 13:08:55 +0000 (15:08 +0200)]
make vlan devices virtual to avoid avl tree issues with changing ifnames when bound to alias interfaces

12 years agodevice: initialize dev->set_state for virtual devices
Felix Fietkau [Thu, 5 Jul 2012 13:06:09 +0000 (15:06 +0200)]
device: initialize dev->set_state for virtual devices

12 years agodevice: export device_broadcast_event
Felix Fietkau [Thu, 5 Jul 2012 13:09:40 +0000 (15:09 +0200)]
device: export device_broadcast_event

12 years agovlan.c: prevent segfault in get_vlan_device_chain() if the base device does not exist
Jo-Philipp Wich [Thu, 5 Jul 2012 11:57:25 +0000 (13:57 +0200)]
vlan.c: prevent segfault in get_vlan_device_chain() if the base device does not exist

12 years agoubus.c: expose metric and mtu values if applicable
Jo-Philipp Wich [Fri, 29 Jun 2012 11:27:27 +0000 (13:27 +0200)]
ubus.c: expose metric and mtu values if applicable

12 years agointerface-ip.{c,h}: add new flag DEVROUTE_MTU and set it for per-route mtu overrides
Jo-Philipp Wich [Fri, 29 Jun 2012 11:26:32 +0000 (13:26 +0200)]
interface-ip.{c,h}: add new flag DEVROUTE_MTU and set it for per-route mtu overrides

12 years agoubus.c: expose route enabled state
Jo-Philipp Wich [Thu, 28 Jun 2012 22:05:43 +0000 (00:05 +0200)]
ubus.c: expose route enabled state

12 years agobridge: fix getting the mac address from the first member device
Felix Fietkau [Tue, 26 Jun 2012 23:32:07 +0000 (01:32 +0200)]
bridge: fix getting the mac address from the first member device

12 years agoadd a #ifdef around the 6rd code to make it compile with older kernels that do not...
Felix Fietkau [Thu, 21 Jun 2012 18:26:49 +0000 (20:26 +0200)]
add a #ifdef around the 6rd code to make it compile with older kernels that do not have 6rd support

12 years agoproto-shell.c: mark device present after reclaiming it, fixes ubus network.device...
Jo-Philipp Wich [Mon, 18 Jun 2012 22:48:12 +0000 (00:48 +0200)]
proto-shell.c: mark device present after reclaiming it, fixes ubus network.device status call after the protocol has been reconnected

12 years agoadd a route6 example to the dummy network config
Felix Fietkau [Mon, 18 Jun 2012 21:41:31 +0000 (23:41 +0200)]
add a route6 example to the dummy network config

12 years agoadd support for using <addr>/<mask> in route/route6 config sections
Felix Fietkau [Mon, 18 Jun 2012 21:41:17 +0000 (23:41 +0200)]
add support for using <addr>/<mask> in route/route6 config sections

12 years agonetifd-proto.sh: execute proto_add_host_dependency() actions in subshell to retain...
Jo-Philipp Wich [Mon, 18 Jun 2012 21:22:55 +0000 (23:22 +0200)]
netifd-proto.sh: execute proto_add_host_dependency() actions in subshell to retain callers environment

12 years agoadd support for defaultroute "host" dependencies
Felix Fietkau [Mon, 18 Jun 2012 21:19:27 +0000 (23:19 +0200)]
add support for defaultroute "host" dependencies

12 years agofix return code in interface_ip_add_target_route
Felix Fietkau [Mon, 18 Jun 2012 21:18:31 +0000 (23:18 +0200)]
fix return code in interface_ip_add_target_route

12 years agofix a memleak in host route dependency handling
Felix Fietkau [Mon, 18 Jun 2012 21:16:25 +0000 (23:16 +0200)]
fix a memleak in host route dependency handling

12 years agoAdd 6rd options to tunnel spec.
Stéphan Kochen [Sun, 17 Jun 2012 15:26:35 +0000 (17:26 +0200)]
Add 6rd options to tunnel spec.

This patch adds support for setting the 6rd tunnel options. These are the same
options normally specified with `ip tunnel 6rd ...`.

Signed-off-by: Stéphan Kochen <stephan@kochen.nl>
12 years agoMove IP address parsing functions to utils.
Stéphan Kochen [Sun, 17 Jun 2012 15:26:34 +0000 (17:26 +0200)]
Move IP address parsing functions to utils.

This is a patch series against the netifd repository.

This first patch moves some previously static functions to utils, so that the
follow up patch may use them from system-linux.c.

Signed-off-by: Stéphan Kochen <stephan@kochen.nl>
12 years agoignore mac80211 devices specified in /etc/config/network
Felix Fietkau [Thu, 14 Jun 2012 16:48:33 +0000 (18:48 +0200)]
ignore mac80211 devices specified in /etc/config/network

12 years agodevice: add support for deferring bringup of devices
Felix Fietkau [Thu, 7 Jun 2012 14:19:52 +0000 (16:19 +0200)]
device: add support for deferring bringup of devices

12 years agodevice: make device_set_disabled inline, add device_set_deferred
Felix Fietkau [Thu, 7 Jun 2012 13:58:32 +0000 (15:58 +0200)]
device: make device_set_disabled inline, add device_set_deferred

12 years agointerface: clean up after hotplug interfaces are removed
Felix Fietkau [Mon, 4 Jun 2012 18:19:53 +0000 (20:19 +0200)]
interface: clean up after hotplug interfaces are removed

12 years agodevice: show a bit more info if the device is not present
Felix Fietkau [Mon, 4 Jun 2012 18:16:57 +0000 (20:16 +0200)]
device: show a bit more info if the device is not present

12 years agoadd an ubus method for dumping available protocol handlers
Felix Fietkau [Thu, 31 May 2012 16:18:52 +0000 (18:18 +0200)]
add an ubus method for dumping available protocol handlers

12 years agoubus: show proto handler in interface status
Felix Fietkau [Thu, 31 May 2012 16:11:36 +0000 (18:11 +0200)]
ubus: show proto handler in interface status

12 years agonetifd: reconnect to ubus if the connection is lost
Felix Fietkau [Tue, 29 May 2012 00:33:13 +0000 (02:33 +0200)]
netifd: reconnect to ubus if the connection is lost

12 years agovlist is now part of libubox
Felix Fietkau [Sat, 26 May 2012 15:56:41 +0000 (17:56 +0200)]
vlist is now part of libubox

12 years agoavl_strcmp is now part of libubox
Felix Fietkau [Sat, 26 May 2012 15:52:19 +0000 (17:52 +0200)]
avl_strcmp is now part of libubox

12 years agofix endian handling of the ipv4 broadcast address
Felix Fietkau [Fri, 25 May 2012 07:54:13 +0000 (09:54 +0200)]
fix endian handling of the ipv4 broadcast address

12 years agobridge: keep existing mac address if specified in the config
Felix Fietkau [Thu, 24 May 2012 18:42:12 +0000 (20:42 +0200)]
bridge: keep existing mac address if specified in the config

12 years agopreserve subnet routes on interface update by not putting them in the route vlist
Felix Fietkau [Wed, 23 May 2012 20:36:19 +0000 (22:36 +0200)]
preserve subnet routes on interface update by not putting them in the route vlist

12 years agoadd interface alias support
Felix Fietkau [Wed, 23 May 2012 20:13:43 +0000 (22:13 +0200)]
add interface alias support

12 years agoreset iface->config_state when handling it
Felix Fietkau [Wed, 23 May 2012 20:07:03 +0000 (22:07 +0200)]
reset iface->config_state when handling it

12 years agobridge: set the mac address based on the first active member
Felix Fietkau [Wed, 23 May 2012 14:09:45 +0000 (16:09 +0200)]
bridge: set the mac address based on the first active member

12 years agoexport dns server and search list in the ubus interface status
Felix Fietkau [Sun, 20 May 2012 13:54:53 +0000 (15:54 +0200)]
export dns server and search list in the ubus interface status

12 years agoflush list in vlist_replace()
Felix Fietkau [Sun, 20 May 2012 13:31:58 +0000 (15:31 +0200)]
flush list in vlist_replace()

12 years agofix argument order on replacing dns lists
Felix Fietkau [Sun, 20 May 2012 13:31:44 +0000 (15:31 +0200)]
fix argument order on replacing dns lists

12 years agodo not replace proto_ip dns servers on config reload
Felix Fietkau [Sun, 20 May 2012 13:20:48 +0000 (15:20 +0200)]
do not replace proto_ip dns servers on config reload

12 years agoreplace the kernel's implicit network routes if the metric is set
Felix Fietkau [Sat, 19 May 2012 23:40:10 +0000 (01:40 +0200)]
replace the kernel's implicit network routes if the metric is set

12 years agopass interface route metric to routes when adding them
Felix Fietkau [Sat, 19 May 2012 22:42:21 +0000 (00:42 +0200)]
pass interface route metric to routes when adding them

12 years agoread interface route metric from config
Felix Fietkau [Sat, 19 May 2012 22:39:23 +0000 (00:39 +0200)]
read interface route metric from config

12 years agomove dns server/search list parsing to interface core to support peerdns=0 + static...
Felix Fietkau [Sat, 19 May 2012 21:21:54 +0000 (23:21 +0200)]
move dns server/search list parsing to interface core to support peerdns=0 + static entries

12 years agoimplement a generic peerdns option to suppress proto handler dns entries
Felix Fietkau [Sat, 19 May 2012 20:57:21 +0000 (22:57 +0200)]
implement a generic peerdns option to suppress proto handler dns entries