summaryrefslogtreecommitdiff
path: root/system-linux.c
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup issues reported by scan-buildSteven Barth2015-04-141-2/+1
| | | | Signed-off-by: Steven Barth <steven@midlink.org>
* Revert "linux: adjust default policy rules"Steven Barth2015-03-311-2/+16
| | | | Signed-off-by: Steven Barth <steven@midlink.org>
* linux: adjust default policy rulesSteven Barth2015-03-271-16/+2
|
* bridge: allow enabling or disabling the multicast querier independently of ↵Matthias Schiffer2015-03-231-1/+1
| | | | | | | | | | | | | | IGMP snooping In larger networks, especially big batman-adv meshes, it may be desirable to enable IGMP snooping on every bridge without enabling the multicast querier to specifically put the querier on a well-connected node. This patch adds a new UCI option 'multicast_querier' for bridges which allows this. The default is still the value of the 'igmp_snooping' option to maintain backwards compatiblity. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* device: fix default initialization for RPS/XPSFelix Fietkau2015-03-221-3/+0
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* device: add support for configuring RPS/XPS (enabled by default if available)Felix Fietkau2015-03-221-0/+35
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* add prelocal table to manipulate locally destinated trafficSteven Barth2015-03-191-0/+14
| | | | Signed-off-by: Steven Barth <steven@midlink.org>
* netifd: Add option to configure base_reachable_time_ms for each deviceHans Dedecker2015-02-091-0/+40
| | | | | | | | The UCI parameter neighreachabletime allows to control the hardware address to IP mapping lifetime in the neighbour table for both IPv4 and IPv6 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> Signed-off-by: Jean-Francois Remy <jeff@melix.org>
* netifd: Add mldversion config supportSteven Barth2014-12-231-12/+22
| | | | | | | | | | | | Config support to set the MLD host version on device level; possible values are : 1 : MLDv1 2 : MLDv2 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> Cleaned up and simplified. Signed-off-by: Steven Barth <steven@midlink.org>
* netifd: Add igmpversion config supportHans Dedecker2014-12-081-0/+34
| | | | | | | | | | | | | Config support to set the IGMP host version on device level; possible values are : 1 : IGMPv1 2 : IGMPv2 3 : IGMPv3 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> Cleand up and simplified Signed-off-by: Steven Barth <steven@midlink.org>
* netifd: Fix restore of original device settingsHans Dedecker2014-12-081-1/+2
| | | | | | | | Don't restore original device settings based on the device settings flags in system_if_down as device flags are already reset when the device config is deleted. Therefore move the masking of the relevant original device settings to system_if_up. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd v2: Fix source routing for IPv4Kristian Evensen2014-11-271-2/+6
| | | | | | | | | | | | | | | | | According to the OpenWRT Network documentation for route, the 'source' option is "The preferred source address when sending to destinations covered by the target". However, netifd currently stores this value in RTA_SRC on NEWROUTE/DELROUTE. RTA_SRC is not used by kernel when handling NEWROUTE nor DELROUTE for IPv4 routes. When adding a new IPv4 route, the source is stored in RTA_PREFSRC and the option works as specified in documentation. For IPv6, the address is still stored in RTA_SRC as to not break source-destination routing for IPv6. v2: Limit patch to IPv4, to prevent breaking IPv6 configurations (thanks Steven Barth) Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
* Fix setting blackhole-routes to kernelSteven Barth2014-11-251-3/+8
| | | | Signed-off-by: Steven Barth <steven@midlink.org>
* netifd: Add acceptlocal config supportHans Dedecker2014-11-191-0/+18
| | | | | | Adds support to accept packets with local source address. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Add rpfilter config supportHans Dedecker2014-11-191-0/+41
| | | | | | | | | | | Reverse path filtering config support; possible values are: 0: no source validation 1|strict: strict mode as packet will be dropped if the incoming interface is not the best reverse path 2|loose: loose mode as packet will be dropped if the source address is not reachable via any interface Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Remove superfluous system_if_resolve callsHans Dedecker2014-11-191-10/+2
| | | | | | | | Don't resolve the ifindex of the parent device again when adding vlandev and macvlan devices as the ifindex has already been resolved. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Fix device ifindex overwrite when processing netlink event messagesHans Dedecker2014-11-191-7/+2
| | | | | | | | | | | When a device with the same name is deleted and created again in the kernel the ifindex changes. A race condition will occur when netlink event messages linked to the old device are processed and will thus overwrite the correct ifindex of the new device. Further make sure a valid ifindex is in place for both external and internal devices when setting the state to enabled. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Read current link state when processing netlink eventHans Dedecker2014-10-241-6/+13
| | | | | | | | | | | | | | | | | Netifd commit b2dcb02570939d98b92c7c55db1c328693a5d52a introduces a race condition resulting into infinite toggling interfaces (eg static interfaces with linksensing enabled, vlan interfaces with proto none (#18106)) when linksensing is enabled resulting into a crash. As netlink event messages will be queued on the netlink event socket the included lower up interface flag will not always represent the current link state when netifd processes the netlink messages; by reading the current link state when a netlink event message is parsed the correct info is passed to the device layer. This will avoid continuous interface toggling (down/up) triggered by link state changes based on outdated netlink interface info. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* system-linux: fix a glob related memleakFelix Fietkau2014-10-241-4/+5
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* device: make link status detection optional for vlan devicesFelix Fietkau2014-10-201-1/+2
| | | | | | | Fixes a race condition that triggers endless link loss / detect calls when VLAN devices are created. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* netifd: IPIP tunnel supportHans Dedecker2014-10-021-29/+82
| | | | | | | | | | | | | | Adds IPIP tunnel support to netifd. Following IPIP tunnel parameters can be configured : -peeraddr (IPv4 remote address) -ipaddr (IPv4 local address) -mtu (IPIP tunnel mtu) -ttl (time to live of encapsulting packets) -tos (type of service either inherit (outer header inherits the value of the inner header) or hex value) -df (don't fragment flag of encapsulating packets) -tunlink (bind tunnel to this interface) Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: GRE Tos supportHans Dedecker2014-09-291-1/+34
| | | | | | | | Tos support is added as a generic gre parameter which can have the following values : -inherit (outer header inherits the tos value of the inner header) -hex value Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd-device: add support for promisc settingMartin Hundebøll2014-09-171-0/+10
| | | | Signed-off-by: Martin Hundebøll <martin@hundeboll.net>
* Disable new-style tunnel creation for older kernelsSteven Barth2014-08-061-0/+4
| | | | Signed-off-by: Steven Barth <steven@midlink.org>
* netifd: GRE tunnel supportHans Dedecker2014-07-301-9/+181
| | | | | | Adds support for gre, gretap, grev6 and grev6tap tunnels Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* bridge: enable multicast querier functionality by defaultFelix Fietkau2014-07-241-0/+3
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* bridge: enable multicast_to_unicast on all wireless bridge portsFelix Fietkau2014-06-291-3/+15
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* system: fix treatment of RT_TABLE_MAINSteven Barth2014-06-201-4/+5
| | | | | | | | | | | Do not treat RT_TABLE_MAIN as RT_TABLE_UNSPEC in system_resolve_rt_table() in order to allow ip rules with lookup main to work as expected. Provide a new function system_is_default_rt_table() to allow calling code to specifically test for RT_TABLE_MAIN, this is going to be needed for the backwards compatible handling of the table attribute in route objects. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* linux: unify functions to delete linksSteven Barth2014-06-181-24/+8
| | | | Signed-off-by: Steven Barth <steven@midlink.org>
* netifd: Route type supportHans Dedecker2014-06-181-39/+64
| | | | | | | | Patch adds route type support in netifd by means of the route parameter type. By default the route type was unicast; the parameter adss support for local/broadcast/multicast/unicast routes which will be put into the appropriate routing table. If route type parameter is unset the route type will be unicast as before. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Fix ipip6 tunnel memleak in case of tunnel creation failureHans Dedecker2014-06-181-10/+34
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Fix macvlan delete via netlinkHans Dedecker2014-06-181-10/+9
| | | | | | | Fix macvlan delete via netlink as netlink attribute IFLA_IFNAME data size was incorrect (size reject by the kernel) and NLM_F_REQUEST flag was missing. In addition some minor improvements (attribute IFLA_INFO_KIND can be left out as RTM_DELLINK does not require the attribute) Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Fix vlan delete via netlinkHans Dedecker2014-06-181-11/+9
| | | | | | | Fix vlan delete via netlink as netlink attribute IFLA_IFNAME data size was incorrect. In addition some minor improvements. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* Add vlan 802.1q/802.1ad support as netifd devicesGioacchino Mazzurco2014-06-111-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | At moment netifd supports just 802.1q vlan, you can configure them using a concise but "hacky" syntax using an interface config section, with this patch netifd acquire the capability of configuring 802.1ad and 802.1q vlan using config device sections, so you can define a vlan device plus interface with something like this: config device 'test' option type '8021ad' option name 'test' option ifname 'eth0' option vid '1000' config interface 'testif' option ifname 'test' option proto 'none' option auto '1' old syntax for 802.1q keeps working so no retrocompatibility problems, to keep retrocompatibility means also that user must not use name/ifname like eth0.2 for devices declared with the new style because this would trigger the "old style" when interface config section is parsed Signed-off-by: Gioacchino Mazzurco <gmazzurco89@gmail.com>
* Add support for onlink-flags for IPv4 routesSteven Barth2014-06-101-0/+1
| | | | Signed-off-by: Steven Barth <steven@midlink.org>
* Rewrite ipip6-tunnel setup to use netlink and add support for FMRsSteven Barth2014-05-211-15/+75
| | | | Signed-off-by: Steven Barth <steven@midlink.org>
* system-linux: always set the ifindex for hotplug devices on initFelix Fietkau2014-05-101-4/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* netifd: Effectively apply configured route mtuHans Dedecker2014-05-091-0/+15
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Add interface config support to enable/disable IPv6 in the kernel ↵Hans Dedecker2014-04-261-2/+42
| | | | | | | | per device Main use case is being able to disable IPv6 on (a) WAN interface(s) when only IPv4 connectivity is offered or 6rd is used. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Fix bridge MTU setting when a bridge member is addedHans Dedecker2014-03-111-6/+9
| | | | | | 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>
* netifd: Link layer state awareness support on device levelHans Dedecker2014-02-271-23/+131
| | | | | | | | | | | | | 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>
* Work around warn_unused_result in recent gcc/libcSteven Barth2014-02-161-2/+2
|
* netifd : Disable netlink auto ackHans Dedecker2014-02-141-2/+3
| | | | | | | | | | | 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>
* Revert "netifd: Link layer state support on device level"Felix Fietkau2013-12-141-96/+21
| | | | This reverts commit c439b52400978dd3799c66e1f632ee68d2c7c9eb.
* IPv6: Remove IPv6 source-routing workaround (kernel is fixed)Steven Barth2013-12-111-0/+4
| | | | Signed-off-by: Steven Barth <steven@midlink.org>
* netifd: Link layer state support on device levelHans Dedecker2013-12-081-21/+96
| | | | | | | Patch implements link layer state awareness (aka carrier detection) in netifd on device level. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* Tunnel don't fragment bit configurableHans Dedecker2013-12-081-4/+6
| | | | | | Make tunnel don't fragment bit configurable via UCI Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Apply tunnel MTUHans Dedecker2013-12-081-2/+5
| | | | | | Tunnel MTU is applied according to the tunnel MTU UCI parameter Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* utils: add a function for checking if a process given by pid is still aliveFelix Fietkau2013-10-221-1/+0
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* device: add macvlan supportFelix Fietkau2013-10-031-0/+88
| | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>