Age | Commit message (Collapse) | Author |
|
Just a typo.
Fixes: f545295 (lib: log errors from platform)
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
https://github.com/thom311/libnl/pull/191
|
|
This function searches a class cache previously allocated with
rtnl_class_alloc_cache() and searches for a class matching the interface
index and parent qdisc.
https://github.com/thom311/libnl/pull/185
|
|
nlmsg_alloc_simple()
This is no change in behavior, because the NL_AUTO_* macros are both
zero.
|
|
expected
|
|
When rtnl_link_change() fails with -NLE_OPNOTSUPP, it retries
with RTM_SETLINK operation. However, it also needs to re-adjust
the sequence number. Otherwise, the second request might fail
with NLE_SEQ_MISMATCH, although it actually succeeded.
[thaller@redhat.com: changed commit message]
https://github.com/thom311/libnl/issues/179
https://github.com/thom311/libnl/pull/184
|
|
rtnl_act_append() does not clone the object, it takes it over
and thus the source object is destroyed.
|
|
This simple classifier allows any traffic pass through.
Useful as an example for port mirroring.
Signed-off-by: Volodymyr Bendiuga <volodymyr.bendiuga@westermo.se>
|
|
[thaller@redhat.com: rewritten commit message]
https://github.com/thom311/libnl/issues/178
https://github.com/thom311/libnl/pull/183
|
|
bridge entries used for switching into vxlan interfaces do not include a
vlan. A comparison of such entires currently always fails which leads
to an invalid cache. This patch selectively adds the NEIGH_ATTR_VLAN
flag based on the passed entry.
https://github.com/thom311/libnl/pull/182
|
|
In case using a VXLAN interface at a bridge you will set L2 bridging
entries using a IP destination to tunnel the according L2 traffic. The
current behavior for the dst entries for a neighbor is to use the AF of
the neighbor itself thus in this case AF_BRIDGE is set. This is changed
in the PR to update the family of the dst using nl_addr_guess_family.
https://github.com/thom311/libnl/pull/180
|
|
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>
|
|
Signed-off-by: Jonas Johansson <jonasj76@gmail.com>
|
|
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Acked-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>
|
|
Both functions are almost identical. Merge them into a common helper
function with an @keep_empty argument, so it is clear at which point
they differ.
Also, fix symbols versioning for nl_attr_keep_empty(). For symbol
versioning, once released a version cannot be modifified/extended.
|
|
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.
|
|
Fix incorrect code indent.
https://github.com/thom311/libnl/pull/165
|
|
Based in the function documentation, peer name could be set regardless
of the link name being informed of not. These parameters should be
checked independently.
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
https://github.com/thom311/libnl/pull/162
|
|
https://github.com/thom311/libnl/pull/159
|
|
Otherwise, calling rtnl_netem_set_delay_distribution_data() will
leak memory, and that should just be supported.
Also, handle failure to allocate memory.
|
|
|
|
|
|
And some style fixes.
|
|
(-Wdeclaration-after-statement)
Avoid gcc warning:
error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
|
|
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
|
|
The previous code would miss to release old_nh in the error
path.
Also, it relied on the present netlink attributes to have old_nh
initialized. Don't do that.
Also, fixup error codes by using "goto errout_nomem" where appropriate
and keep @err as returned from rtnl_route_set_metric().
|
|
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.
|
|
By a factor of 1.5 instead of 2, to value wasted storage overhead
higher then the number of operations.
Also, check for integer overflows.
|
|
We need to copy the entire source struct over
from source to destination.
The only thing that needs special handling is
to deep-clone the vi_egress_qos buffer.
Fixes: a7469ce758fac3631df6ce72eb3f89150070e7f8
|
|
If you set more than four entries for the vlan egress map a memory
corruption occurs because the reallocation does not reserve memory
for more than four.
Fixes: a7469ce758fac3631df6ce72eb3f89150070e7f8
https://github.com/thom311/libnl/pull/155
[thaller@redhat.com: squashed commits and updated commit message]
|
|
Since the neigh cache can contain msgs from different families,
print family id to distinguish neigh cache entries in the
dump output
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
Since the link cache can contain msgs from different families,
print family id to distinguish link cache entries in the
dump output
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
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>
|
|
netconf_msg_parser is leaking memory. Add the put in the newly
allocated nc object to release the initial reference.
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
http://lists.infradead.org/pipermail/libnl/2017-September/002378.html
|
|
in rtnl_link_vf_vlan_alloc() function allocating memory to
vlans while checking NULL or not vf_vlans.
it can cause memory leak.
Signed-off-by: Amit Khatri <amit.khatri@samsung.com>
Signed-off-by: Rohit Pratap Singh <rohit.s@samsung.com>
Fixes: 5d6e43ebef12deadf31fccfa46c0b34892675d36
http://lists.infradead.org/pipermail/libnl/2017-August/002373.html
|
|
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>
|
|
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>
|
|
MPLS 'addresses' are 4-byte labels with a prefix length of 20.
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>
|
|
https://github.com/thom311/libnl/issues/148
|
|
|
|
I'm not 100% sure this is the correct fix; maybe this really is supposed
to return family->gf_maxattr, but this is an odd way of writing
that. Anyway, comparing to the other genl_family_[gs]et functions, I
suppose this is what was really meant.
|
|
This is clearly not what was intended. While at it, drop the pointless
cast of the allocator's return value, and use plain malloc since we're
explicitly populating all len bytes immediately afterwards.
|