summaryrefslogtreecommitdiff
path: root/accel-pppd/libnetlink/iputils.c
AgeCommit message (Collapse)Author
2023-06-26libnetlink: fix a crash with a non vlan interfacePhilippe Guibert
Fix a segmentation fault when starting when accel-ppp is configured with an non vlan interface. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-11-01Use 64-bit interface statistics rather than doing custom 32-bit overflow ↵Stephan Brunner
handling. When a link has a relatively high throughput, the 32-bit packet and byte counters could overflow multiple times between accounting runs. To accommodate this limitation, directly use 64-bit interface statistics. This also gets rid of the internal giga-word counters.
2018-12-20iputils: remove unnecessary NLM_F_ACKGuillaume Nault
Using NLM_F_ACK in these functions is confusing because they don't parse any netlink response. In fact, NLM_F_ACK is only required internally by rtnl_talk(), which already adds it when its 'answer' parameter is NULL. Therefore it's useless to manually set it in functions that don't set 'answer'. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-12-20iputils: remove NLM_F_CREATE flag from ip6{route,addr}_del()Guillaume Nault
These are deletion requests. NLM_F_CREATE is confusing for readers and ignored by kernel. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-12-20iputils: always set scope to RT_SCOPE_UNIVERSE in ip6route_{add,del}()Guillaume Nault
No need to be clever here. All IPv6 routes have global scope (kernel ignores rtm_scope for IPv6 and always reports RT_SCOPE_UNIVERSE when dumping such routes). Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-12-20iputils: set scope depending on gateway in iproute_{add,del}()Guillaume Nault
From a logical point of view, we have link scope if no gateway is present, and global scope otherwise. Therefore it makes more sense to set rtm_scope depending on 'gw' rather than on 'ifindex'. Currently, callers of iproute_add() and iproute_del() either set 'ifindex' or 'gw', but never both. So even if confusing, the current code results in right scope selection. However one can't figure this out without analysing every caller. We should set rtm_scope based on the presence of the gateway instead. Given the current code base, that doesn't change the end result, but that better maches the scope concept. Also, that's the way iproute2 does its selection. Furthermore, it'd be perfectly valid to have both 'iface' and 'gw' set. In that case, scope should be RT_SCOPE_UNIVERSE instead of RT_SCOPE_LINK. Basing scope selection on 'gw' makes this case work correctly. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-12-20iputils: add 'src' and 'gw' parameters to iproute_del()Guillaume Nault
Rework iproute_del() to have the same parameters as iproute_add(). This will allow callers to specify more precisely the route they want to delete. Callers will later be converted to make use of these parameters to ensure that the removed route precisely matches the one that was originaly inserted. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-12-04libnetlink: add gateway and priority parameters to ip6route_*()Guillaume Nault
Let callers set a gateway and a priority to IPv6 routes. This is necessary for implementing the RADIUS Framed-IPv6-Route attribute. Also let ip6route_del() configure .rtm_protocol. This is already implemented in ip6route_add(), so we need to add the ip6route_del() counterpart. Otherwise, we couldn't delete routes that were added using a non-zero protocol. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-05-25ifcfg: assign p-t-p address if mask=32 and regular address in other casesDmitry Kozlov
2018-05-25ifcfg: assign address using ipaddr_add_peer instead SIOCSIFADDR/SIOCSIFDSTADDRDmitry Kozlov
2018-02-21radius: add support for route priority (metric) in Framed-RouteGuillaume Nault
Let an optional route priority (aka metric) be defined in RADIUS Framed-Route attributes. The priority is an integer placed at the end of the route string. This is backward compatible with the previous format and also conforms with the recommended format defined by RFC 2865 (although we don't allow multiple metrics). Framed-Route format is: <network> [<gateway> [<priority>]] For example, 'Framed-Route = "192.0.2.0/24 203.0.113.1 8"' will let the following route be installed (assuming 203.0.113.1 is routed through eth0): $ ip route show [...] 192.0.2.0/24 via 203.0.113.1 dev eth0 metric 8 It's possible to use the unspecified gateway (0.0.0.0) if one wants to set a priority without specifying a gateway address. Finally, route deletion now also takes the priority into account, in order to avoid removing a different route accidentally. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-01-13ipv6: fix host scope routesVladislav Grishenko
2017-12-25libnetlink: added ip6addr_add_peer functionDmitry Kozlov
2017-09-25libnetlink: added function iplink_set_mtuDmitry Kozlov
2016-12-08ipoe: fixed nat supportDmitry Kozlov
2016-11-12ipoe: add support for peer-to-peer client interfacesMichael Furmur
2016-07-11implemented support for network namespaceDmitry Kozlov
This is done using radius attribute NAS-Port-Id. The new format of this attribute is NAS-Port-Id=[ns/][name]. Namespaces must be created malually by "ip netns add ..." command
2016-04-12ipv6: remove ipv6 address and routes on session terminationDmitry Kozlov
2016-04-05iputils: check for IFLA_INFO_KIND presenceDmitry Kozlov
2016-04-04ipoe,pppoe,vlan_mon: deleted conditions to simultaneous start ipoe and pppoe ↵Dmitry Kozlov
on same interfaces (started by vlan_mon)
2016-01-03iputils: improved iproute_add and iproute_del functionsDmitry Kozlov
2015-12-25accel-dp: formed skeletonDmitry Kozlov
2015-11-18ipoe: for vlan name pattern implemented %P argument - VID of parent interfaceDmitry Kozlov
2014-12-01ipv6: if assigned prefix is <= 64 add it as address else add it as routeDmitry Kozlov
2014-10-28libnetlink: fixed bug introduced by previous commitDmitry Kozlov
2014-10-27ipoe: implemented handling relayed DHCP clientsDmitry Kozlov
2014-07-18ipv6: add support for prefixes greater than 64Dmitry Kozlov
2014-05-26ipoe: introduced "ip-unnumbered" optionDmitry Kozlov
Before this time accel-ppp always worked in "ip unnumbered" mode. This option may turn this mode off (default is on)
2014-01-19increase size of buffer for netlink messagesDmitry Kozlov
Signed-off-by: Dmitry Kozlov <xeb@mail.ru>
2013-10-30ipoe: implemented source/local address detection for up sessionsDmitry Kozlov
Signed-off-by: Dmitry Kozlov <xeb@mail.ru>
2013-09-01ipoe: implemented vlan monitorDmitry Kozlov
2013-08-31ipoe: fixed race during receiving relay replyDmitry Kozlov
2013-07-26ipoe: fixed route deletion (pass proper proto)Kozlov Dmitry
2013-06-13ipoe: introduced 'proto' option that will be used for inserted routesDmitry Kozlov
2013-01-26ipoe: various fixesKozlov Dmitry
2012-09-05generalize interface statistics gatheringKozlov Dmitry