| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
Signed-off-by: Volodymyr Bendiuga <volodymyr.bendiuga@westermo.se>
|
|
|
|
|
|
|
| |
Add support for recent fib rule features - specifying a protocol
that installed a rule and an IP protocol plus port range for rules.
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
|
|
|
|
|
|
|
| |
Update fib_rules.h to kernel as of bfff4862653b
("net: fib_rules: support for match on ip_proto, sport and dport")
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
|
|
|
|
|
| |
Public defines must have a libnl3 related prefix. Rename
GENEVE_ID_MAX to RTNL_GENEVE_ID_MAX.
|
|
|
|
| |
Signed-off-by: Wang Jian <jianjian.wang1@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Currently, due to the incomplete netlink datagram sent by libnl, cgroup
filter addition is not fully functional. The datagram generated by `tc`
command includes an empty attribute section, which is stripped off
in the libnl counterpart.
In this commit, a new `interface nla_nest_end_keep_empty()` is added.
This function closes attribute without stripping off empty attribute.
|
|
|
|
|
|
|
|
|
| |
After rethinking, "tcm_params" doesn't seem like a good name. Change it to
"tc_params".
Also, an already released section in the linker file must never be
modified. It defeats the purpose of symbol versioning. Move the symbol
to the right section.
|
|
|
|
|
|
|
| |
It is not good to give classifier cache users only one chance to
set interface index and parent handle when allocte new cache.
Sometimes we want to reuse classifier cache to reduce the overhead
of allocating new memory everytime a new cache is created.
|
| |
|
|
|
|
|
|
|
|
|
| |
A new function rtnl_netem_set_delay_distribution_data() has been added
to allow the user to pass the delay distribution directly without loading
it from a file.
In conjunction with the maketable code (see iproute2 / NISTnet) this can
be used to generate and load custom delay distributions on the fly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
rtnl_link_af_ops.ao_override_rtm allows for a link module to
override the change request type being sent to the kernel. More
specifically, the default change request type is RTM_NEWLINK.
Some link change requests require the reqeust type to be set to
RTM_SETLINK. This is the case for IFLA_PROTINFO specific
attributes for a link that is slave to a bridge.
Currently, ao_override_rtm is static to the address family type.
So, all changes submitted to AF_BRIDGE override the link change
request type. The override only needs to happen if IFLA_PROTINFO
attributes are appended to the link change request.
This patch changes ao_override_rtm from a const integer to a
function pointer that allows for a link module to determine if
the override needs to actually happen.
Currently, only the bridge module uses this functionality. If
bridge flags are applied to a link (bdpu blocking, learning,
fast leave, etc...), these flags are nested in IFLA_PROTINFO. If
the flags are present, the link change request type will be
overridden as RTM_SETLINK.
This fixes the ability to set a bridge link up or down by using
the correct RTM_NEWLINK link change request type.
$ sudo src/nl-link-set -n br2 --state=down
Changed bridge br2 ether a6:e6:94:8c:61:ec
<broadcast,multicast,up,running,lowerup> group 0
$ ip link show
br2: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue
state DOWN mode DEFAULT group default qlen 1000
$ sudo src/nl-link-set -n br2 --state=up
Changed bridge br2 ether a6:e6:94:8c:61:ec
<broadcast,multicast> group 0
$ ip link show
br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
state UNKNOWN mode DEFAULT group default qlen 1000
Signed-off-by: Jef Oliver <jef.oliver@intel.com>
Fixes: 55bc931a7272e6ac8f555bcc2a373eb2b6b58377
http://lists.infradead.org/pipermail/libnl/2017-November/002382.html
http://lists.infradead.org/pipermail/libnl/2017-November/002385.html
|
|
|
|
|
|
|
| |
rtnl_link_vlan_set_egress_map()
Without this fix/capablity, adding more then 4 mappings in
rtnl_link_vlan_set_egress_map() overflows the heap.
|
|
|
|
|
|
|
|
|
|
|
| |
Adding const to a function argument is generally not an API break
(at least, if the argument is a struct, like in this case).
Usually we declare the policy as static variables. The user should
be able to mark them as "const", so that the linker makes the policy
array read-only. Adjust the API to allow for that.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
| |
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some of the cli tools use select(2) and its man page states:
/* According to POSIX.1-2001, POSIX.1-2008 */
#include <sys/select.h>
Do so and explicitly #include <sys/select.h> in <netlink/cli/utils.h>
instead of relying of getting select(2) via implicit includes. This is
also needed to make libnl compile for Android.
Based on a previous patch by Fredrik Fornwall.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
https://github.com/thom311/libnl/pull/151
|
|
|
|
|
|
| |
Add support for MPLS lwtunnel encapsulation.
Signed-off-by: David Ahern <dsahern@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Add framework to support lwtunnel encapsulations per nexthop.
Encapsulations types are expected to fill in the nh_encap_ops for
building and parsing messages, compare encapsulations in routes,
dumping the encapsulations and freeing memory.
Signed-off-by: David Ahern <dsahern@gmail.com>
|
|
|
|
|
|
|
| |
Import lwtunnel and mpls_iptunnel.h from net-next tree as of commit
b217566a525ff24334d17635a865f44b68c2c583
Signed-off-by: David Ahern <dsahern@gmail.com>
|
|
|
|
|
|
|
| |
Add support for RTA_TTL_PROPAGATE attribute on a per-route basis.
Used to enable/disable TTL propagation at LSP egress.
Signed-off-by: David Ahern <dsahern@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for route in MPLS family. New attributes:
- RTA_NEWDST - label stack for a nexthop
- RTA_VIA - nexthop address (e.g., IPv4 or IPv6)
Other changes required:
- scope has to be universe for MPLS routes so fixup rtnl_route_guess_scope
- priority attribute can not be set for MPLS. Change rtnl_route_parse to
not set the attribute by default for AF_MPLS.
- table attribute should not be set unless something other than the default
table. For MPLS this attribute can not be set.
'/' is the separator in label stacks for consistency with iproute2.
Signed-off-by: David Ahern <dsahern@gmail.com>
|
|
|
|
|
|
| |
Implementations of mpls_ntop and mpls_pton taken from iproute2.
Signed-off-by: David Ahern <dsahern@gmail.com>
|
|
|
|
|
|
|
| |
Add include/uapi/linux/mpls.h from net-next tree as of commit
b217566a525ff24334d17635a865f44b68c2c583
Signed-off-by: David Ahern <dsahern@gmail.com>
|
|
|
|
|
|
|
| |
Update to rtnetlink.h to top of net-next tree as of commit
b217566a525ff24334d17635a865f44b68c2c583
Signed-off-by: David Ahern <dsahern@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
After kernel commit a07ea4d9941a ("genetlink: no longer support using
static family IDs"), GENL_ID_GENERATE is no longer exposed to userspace
(and actually should never have been). Update the private header copy of
linux/genetlink.h accordingly. And replace the two occurences of
GENL_ID_GENERATE.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
https://github.com/thom311/libnl/pull/144
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 3cb28534d34392ceec4adead0cfa97039796ccb7 enables building
of cli always as part of `make check`. As cli previously always
included <dlfcn.h>, this broke tests for building with toolchains
that don't support dynamic library loading.
Add a configure check and disable dlopen() based on whether
<dlfcn.h> is available.
Signed-off-by: Thomas Haller <thaller@redhat.com>
https://github.com/thom311/libnl/pull/141
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- for rtnl_rule_set_l3mdev(), also allow unsetting the l3mdev field.
In practice, kernel only allows for two options: either omit
tb[FRA_L3MDEV] or set it to 1. As such, rtnl_rule_set_l3mdev()
allows for both of these. In principle the setter could get
extended to set other values. Such values are reserved.
- for rtnl_rule_get_l3mdev() also return an error code. I think it
is appropriate to mix value and negative error code, as long as
the range of values cannot overlap with error codes.
Arguably, the outcome is a bit awkward, as the function now is
expected to return -NLE_MISSING_ATTR or 1. So, the best check
is probably
if (rtnl_rule_get_l3mdev(r) > 0) { ... }
The reason for this change is that libnl should expose the netlink
API without coercing uint8 to boolean. That way, future changes
in kernel don't require update to libnl3.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for the l3mdev option in FIB rules. If l3mdev is set
then the lookup is directed to the table associated with the l3mdev
(e.g., VRF) device.
If the l3mev attribute is set the table id is not, so update the table
id attribute to make sure r_table is non-0.
iproute2 shows the rule as:
1000: from all lookup [l3mdev-table]
where [l3mdev-table] infers the dynamic nature of the table id. Keep
that notation for libnl.
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
| |
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support to netconf for MPLS address family.
v2
- change get method to return 0/error and take 'int *val'
which is set to the value requested
- added rtnl_netconf_get_input to libnl-route-3.sym
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add route/netconf cache type to monitor RTM_*NETCONF messages.
v2
- change get methods to return 0/error and take 'int *val'
which is set to the value requested
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: Balakrishnan Raman <ramanb@cumulusnetworks.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
| |
Add accessor functions to retrieve actions on a tc object
and provide additional function to navigate the collection
of actions.
|
|
|
|
|
|
|
|
| |
Add functions to access the IPv6 specific flags of a link object.
Also the functions for IPv6 link flags translation are now exported, similar
to the non IPv6 specific translation functions.
https://github.com/thom311/libnl/pull/136
|
|
|
|
| |
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
The previous commits reorganized the public headers to drop includes
of linux kernel headers.
Restore the previous situation because otherwise the change might
break compilation for users who rely on certain headers getting dragged
in by libnl3.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It would be desirable not to include kernel headers in our public
libnl3 headers. As a test, remove all those includes, and fix
compilation by explicitly including the kernel headers where needed.
In some cases, that requires forward declaration for kernel
structures, as we use them as part of our own headers.
Realistically, we cannot drop those includes as it probalby breaks
compilation for users that expect to get a certain kernel header
when including a libnl3 header. So, this will not be done and the
includes will be restored in the next commit.
Do this step to show how it would be and to verify that we could
build with such a change. The reason not to do this is backward
compatibility (at compile-time).
|
|
|
|
|
|
|
|
|
|
| |
The previous API of xfrmnl_sp_get_sec_ctx() is totally broken,
as it requires all out-arguments to be set. The user can thus
not know how large the ctx_str buffer must be.
Fix the API by allowing all arguments to be optional. Thus,
a user can first query the size only, and then in a second
step query the ctx_str. Previous version are broken.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fdb cache is per bridge and hence hashed by:
<bridge_ifindex, family, mac>
newer kernels send bridge ifindex in NDA_MASTER.
Use NDA_MASTER for neigh->n_master when available.
Also imports a few more NDA_* attributes from upstream
to keep linux/neighbour.h NDA_* attributes in sync with
upstream.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
|
| |
|
|\
| |
| |
| | |
https://github.com/thom311/libnl/pull/125
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Include the own public header in order to get function prototypes for
all public functions defined in this module.
This fixes GCC -Wmissing-prototype warnings.
Also adjust the function prototype of xfrmnl_sa_get_sec_ctx() to
match the definition.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add missing function prototype for idiagnl_req_parse() to the public
header.
This fixes the following GCC warning when compiling with
-Wmissing-prototypes:
idiag/idiag_req_obj.c:189:5: warning: no previous prototype for ‘idiagnl_req_parse’ [-Wmissing-prototypes]
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add missing function prototypes for nfnl_exp_unset_flags(),
nfnl_exp_flags2str() and nfnl_exp_str2flags() to the public header.
This fixes the following GCC warnings when compiling with
-Wmissing-prototypes:
netfilter/exp_obj.c:458:6: warning: no previous prototype for ‘nfnl_exp_unset_flags’ [-Wmissing-prototypes]
netfilter/exp_obj.c:475:8: warning: no previous prototype for ‘nfnl_exp_flags2str’ [-Wmissing-prototypes]
netfilter/exp_obj.c:481:5: warning: no previous prototype for ‘nfnl_exp_str2flags’ [-Wmissing-prototypes]
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add the function prototype for nfnl_queue_msg_build_verdict_batch() to
the public header.
This fixes the following GCC warning when building with
-Wmissing-prototypes:
netfilter/queue_msg.c:190:1: warning: no previous prototype for ‘nfnl_queue_msg_build_verdict_batch’ [-Wmissing-prototypes]
Fixes: d612180cda43 ("netfilter/queue: introduce nfnl_queue_msg_send_verdict_batch()")
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add the function prototype for rtnl_link_is_ipip() to the public header.
This fixes the following GCC warning when compiling with
-Wmissing-prototypes:
route/link/sit.c:400:5: warning: no previous prototype for ‘rtnl_link_is_sit’ [-Wmissing-prototypes]
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add missing "_ipvti" part to function prototypes so they match the
exported name. Also add the missing prototype for rtnl_link_is_ipvti().
This fixes the following GCC warnings when compiling with
-Wmissing-prototypes:
route/link/ipvti.c:281:5: warning: no previous prototype for ‘rtnl_link_is_ipvti’ [-Wmissing-prototypes]
route/link/ipvti.c:369:10: warning: no previous prototype for ‘rtnl_link_ipvti_get_ikey’ [-Wmissing-prototypes]
route/link/ipvti.c:403:10: warning: no previous prototype for ‘rtnl_link_ipvti_get_okey’ [-Wmissing-prototypes]
route/link/ipvti.c:437:10: warning: no previous prototype for ‘rtnl_link_ipvti_get_local’ [-Wmissing-prototypes]
route/link/ipvti.c:471:10: warning: no previous prototype for ‘rtnl_link_ipvti_get_remote’ [-Wmissing-prototypes]
Also fix the corresponding names in documentation.
Fixes: 8f6301426a00 ("ipvti: introduce vti tunnel support")
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add the function prototype for rtnl_link_is_ipip() to the public header.
This fixes the following GCC warning when compiling with
-Wmissing-prototypes:
route/link/ipip.c:296:5: warning: no previous prototype for ‘rtnl_link_is_ipip’ [-Wmissing-prototypes]
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add the function prototypes for the struct flnl_result attribute access
functions to the public header fib_lookup/lookup.h
This fixes the following GCC warnings when compiling with
-Wmissing-prototypes:
fib_lookup/lookup.c:284:5: warning: no previous prototype for ‘flnl_result_get_table_id’ [-Wmissing-prototypes]
fib_lookup/lookup.c:289:5: warning: no previous prototype for ‘flnl_result_get_prefixlen’ [-Wmissing-prototypes]
fib_lookup/lookup.c:294:5: warning: no previous prototype for ‘flnl_result_get_nexthop_sel’ [-Wmissing-prototypes]
fib_lookup/lookup.c:299:5: warning: no previous prototype for ‘flnl_result_get_type’ [-Wmissing-prototypes]
fib_lookup/lookup.c:304:5: warning: no previous prototype for ‘flnl_result_get_scope’ [-Wmissing-prototypes]
fib_lookup/lookup.c:309:5: warning: no previous prototype for ‘flnl_result_get_error’ [-Wmissing-prototypes]
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
rtnl_red_get_limit()
This fixes the following GCC warnings when compiling with
-Wmissing-prototypes:
route/qdisc/red.c:136:6: warning: no previous prototype for ‘rtnl_red_set_limit’ [-Wmissing-prototypes]
route/qdisc/red.c:152:5: warning: no previous prototype for ‘rtnl_red_get_limit’ [-Wmissing-prototypes]
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add missing function prototyoe for rtnl_link_vf_vlan_free() to the
public header.
This fixes the following GCC warning when compiling with
-Wmissing-prototypes:
route/link/sriov.c:1339:6: warning: no previous prototype for ‘rtnl_link_vf_vlan_free’ [-Wmissing-prototypes]
Fixes: 5d6e43ebef12 ("lib/route: SRIOV Parse and Read support")
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|