| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| | |
Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
|
| |
| |
| |
| |
| |
| |
| | |
Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
--
v2: use new kernel api like for nfqueue
|
|/
|
|
| |
Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
|
|
|
|
|
|
|
| |
This patch adds support for IPv6 GRE tunneling
that uses the ip6_gre kernel module.
https://github.com/thom311/libnl/pull/255
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
rtnl_neigh.n_family should be set as AF_BRIDGE when we want to add a fdb entry,
but the func build_neigh_msg does not allow dst addr to be put at that time.
Here is the example:
struct rtnl_neigh *neigh = rtnl_neigh_alloc();
struct nl_addr *mac = nl_addr_build(AF_LLC, eth, ETH_ALEN);
struct nl_addr *dst = nl_addr_build(AF_INET, addr, 4);
rtnl_neigh_set_ifindex(neigh, rtnl_link_get_ifindex(vxlan_link));
rtnl_neigh_set_state(neigh, NUD_NOARP | NUD_PERMANENT);
rtnl_neigh_set_lladdr(neigh, mac);
rtnl_neigh_set_flags(neigh, NTF_SELF);
rtnl_neigh_set_dst(neigh, dst);
rtnl_neigh_set_family(neigh, AF_BRIDGE);
rtnl_neigh_add(sk, neigh, NLM_F_CREATE);
Then command "bridge fdb show" will print out the fdb entry:
02:68:60:19:6b:a4 dev flannel.1 dst 10.40.252.12 self permanent
Signed-off-by: huangxuesen <huangxuesen@kuaishou.com>
Signed-off-by: wangli09 <wangli09@kuaishou.com>
https://github.com/thom311/libnl/pull/260
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Spit the function into 2 parts:
- where first being responsible for memory allocation/cloning
- and second for populating the destination object
Make proper cloning of 'action' attribute. For now, only the
first action in chain is included in the clone.
Signed-off-by: Magnus Öberg <magnus.oberg@westermo.se>
Signed-off-by: Volodymyr Bendiuga <volodymyr.bendiuga@westermo.se>
[thaller@redhat.com: fix using the correct cleanup macros]
https://github.com/thom311/libnl/pull/245
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
rtnl_tc_data() allocates a data if necessary (or ENOMEM). So the code
void *a = rtnl_tc_data(dst), *b = rtnl_tc_data(src);
if (!a)
return 0;
else if (!b)
return -NLE_NOMEM;
is not right. It also means, rtnl_tc_clone() will always add the data
pointers if the previously doesn't exist. In particular, it means
that clone modifies "src", and that "dst" will always have an allocated
pointer afterwards. Fix that.
Also, add a comment about the subtleties for how to_clone() must fix the
aliased pointers. Otherwise, we will crash. All implementations actually
got this wrong earlier, and it only worked if they didn't encounter
ENOMEM.
|
|
|
|
|
|
|
|
|
|
|
| |
rtnl_tc_clone() first does a shallow-copy (nl_data_clone()), and then
calls the to_clone() implementation. We need the shallow-copy, because
we want that by default all simple fields get cloned automatically.
But it means, we *must* take care of all pointers in the to_clone()
implementation, and must never return without fixing them. Otherwise
we will do a double free. An early "return -NLE_NOMEM;" leaves the
pointer unchanged, and two objects own the same data (double free
and use-after-free says hello).
|
|
|
|
|
| |
Of the struct has no pointers that require a deep copy, there is
no need to implement to_clone().
|
| |
|
| |
|
|
|
|
|
|
|
| |
It's important to have no leaks in tests. Otherwise, we cannot
distinguish irrelevant leaks from actual bugs in valgrind.
Do some cleanup.
|
| |
|
|
|
|
|
|
| |
fail_if() is deprecated. See also commit 3d1fb006c859
('tests/check-addr: replace deprecated fail_if() macro from libcheck
with ck_assert_msg()').
|
|
|
|
|
|
|
|
| |
This fixes an incorrect output.
Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
https://github.com/thom311/libnl/pull/250
|
|
|
|
|
|
| |
[thaller@redhat.com: whitespace fix]
https://github.com/thom311/libnl/pull/254
|
|\
| |
| |
| |
| |
| | |
Upstream SONiC MPLS changes to libnl3.
https://github.com/thom311/libnl/pull/284
|
| |
| |
| |
| |
| | |
[thaller@redhat.com: split original patch, reword commit message
and fix symbols in "libnl-route-3.sym"]
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
nl_addr_valid() expects an address family as argument, not the length.
It also expects an address in string form, not in binary.
Those checks were wrong. Also, it seems not necessary to validate the
argument, purely based on some criteria of the argument alone. Just set
the provided address.
Drop those checks.
This is relevant for NEWDST and ENCAP_MPLS DST processing.
Fixes: 760d74f99c88 ('route: Add support for MPLS encap')
Fixes: 0a6d27ce90a1 ('route: Add support for MPLS address family')
[thaller@redhat.com: split original patch and rewrite commit message].
|
|
|
|
|
|
| |
https://github.com/thom311/libnl/issues/281
https://github.com/thom311/libnl/pull/282
|
|
|
|
|
|
|
|
| |
[thaller@redhat.com: split original patch and rewrite commit message]
Fixes: 5251188673e4 ('link: basic socket-CAN support')
https://github.com/thom311/libnl/pull/274
|
|
|
|
|
|
| |
[thaller@redhat.com: picked partial patch and rewrite commit message]
https://github.com/thom311/libnl/pull/277
|
|\
| |
| |
| |
| |
| | |
't0mmmy90:check-if-nh-exists-while-updating-ipv6-multipath-route'
https://github.com/thom311/libnl/pull/290
|
| |
| |
| |
| |
| |
| | |
The check is right, that we skip adding the next hop if it already exists.
However, we must not return a failure. Instead, we need to return success,
that the old object is already good.
|
|/ |
|
|
|
|
| |
and drop the defunct travis.
|
|
|
|
|
|
|
|
|
| |
ck_assert_msg()
fail_if() is long deprecated. Worse, it triggers a "-Wformat-extra-args"
warning due to a trailing NULL. See [1].
[1] https://github.com/libcheck/check/commit/82540c5428d3818b64d6a8aefb601e722520651f
|
|
|
|
|
|
| |
Trivial name change for consistency.
https://github.com/thom311/libnl/pull/276
|
|
|
|
| |
https://github.com/thom311/libnl/pull/291
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To comply with the latest POSIX standard, in Yacc compatibility mode
(options `-y`/`--yacc`) Bison now generates prototypes for yyerror and
yylex. In some situations, this is breaking compatibility: if the user
has already declared these functions but with some differences (e.g., to
declare them as static, or to use specific attributes), the generated
parser will fail to compile. To disable these prototypes, #define yyerror
(to `yyerror`), and likewise for yylex.
refer: https://git.savannah.gnu.org/cgit/bison.git/tree/NEWS
GNU Bison 3.8
https://github.com/thom311/libnl/issues/294
https://github.com/thom311/libnl/pull/295
|
|\
| |
| |
| | |
https://github.com/thom311/libnl/pull/296
|
| |
| |
| |
| |
| | |
Sections with already released API must not be modified or
extended. A new section must be added for each release.
|
| |
| |
| |
| |
| |
| | |
Otherwise, we cannot just access the netlink attribute and
be sure it has the right size. Add the length to the policy,
so it gets validated.
|
|/
|
|
| |
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
|
|
|
|
|
|
| |
[thaller@redhat.com: adjust libnl-route-3.sym file]
https://github.com/thom311/libnl/pull/300
|
|
|
|
| |
https://github.com/thom311/libnl/pull/292
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When running valgrind on an application that uses
xfrmnl_build_sa_delete_request, it reports the following error:
==783216== Syscall param sendmsg(msg.msg_iov[0]) points to uninitialised byte(s)
==783216== at 0x4DF771D: sendmsg (in /usr/lib64/libpthread-2.33.so)
==783216== by 0x48627D9: nl_sendmsg (nl.c:336)
==783216== by 0x4862993: nl_send_iovec (nl.c:401)
==783216== by 0x48629F9: nl_send (nl.c:453)
==783216== by 0x48629F9: nl_send (nl.c:441)
==783216== by 0x4931B89: xfrmnl_sa_delete (sa.c:1379)
==783216== by 0x40A390: delete_associated_state (net-api.c:88)
==783216== by 0x40C191: del_tunnel (net-api.c:883)
==783216== by 0x414EB0: net_api_test_tunnel (net-api_test.c:181)
==783216== by 0x4DD763A: ??? (in /usr/lib64/libcunit.so.1.0.1)
==783216== by 0x4DD79C0: ??? (in /usr/lib64/libcunit.so.1.0.1)
==783216== by 0x4DD8966: CU_run_all_tests (in /usr/lib64/libcunit.so.1.0.1)
==783216== by 0x422E13: RunAllTests (test.c:87)
==783216== by 0x422FA9: main (test.c:150)
==783216== Address 0x5217394 is 20 bytes inside a block of size 4,096 alloc'd
==783216== at 0x4845464: calloc (vg_replace_malloc.c:1117)
==783216== by 0x4860CF5: __nlmsg_alloc (msg.c:269)
==783216== by 0x4860FFE: nlmsg_inherit (msg.c:321)
==783216== by 0x4861091: nlmsg_alloc_simple (msg.c:352)
==783216== by 0x4931AA5: build_xfrm_sa_delete_message (sa.c:1340)
==783216== by 0x4931AA5: xfrmnl_sa_build_delete_request (sa.c:1367)
==783216== by 0x4931B58: xfrmnl_sa_delete (sa.c:1375)
==783216== by 0x40A390: delete_associated_state (net-api.c:88)
==783216== by 0x40C191: del_tunnel (net-api.c:883)
==783216== by 0x414EB0: net_api_test_tunnel (net-api_test.c:181)
==783216== by 0x4DD763A: ??? (in /usr/lib64/libcunit.so.1.0.1)
==783216== by 0x4DD79C0: ??? (in /usr/lib64/libcunit.so.1.0.1)
==783216== by 0x4DD8966: CU_run_all_tests (in /usr/lib64/libcunit.so.1.0.1)
==783216== by 0x422E13: RunAllTests (test.c:87)
==783216== by 0x422FA9: main (test.c:150)
==783216== Uninitialised value was created by a stack allocation
==783216== at 0x492DA10: ??? (in /home/nhorman/git/privafy/microedge-c/external_libs/install/lib/libnl-xfrm-3.so.200.26.0)
It occurs because the sa_id value thats allocated on the stack isn't
completely initalized (if you're using ipv4, the daddr winds up with
garbage in the extra bytes). Its not critical, but it would be nice to
avoid sending that garbage into the kernel, and it would silence the
valgrind error.
Easy fix, just memset the sa_id before copying it into the nlmsg.
Signed-off-by: Neil Horman <nhorman@gmail.com>
https://github.com/thom311/libnl/pull/297
|
|\
| |
| |
| | |
https://github.com/thom311/libnl/pull/283
|
| | |
|
| |
| |
| |
| |
| | |
'data' was leaked when returning -NLE_INVAL. Fix this by using the
cleanup attribute.
|
| | |
|
|/
|
|
|
|
| |
The destination object doesn't have to be allocated because it's
passed as _dst argument. Also, the function doesn't have to copy plain
fields.
|
|
|
|
|
|
|
|
| |
Required to be notified about inet6 managed/otherconf flag changes, see
occurrences of inet6_ifinfo_notify in net/ipv6/ndisc.c of the Linux
kernel.
https://github.com/thom311/libnl/pull/264
|
|
|
|
| |
https://github.com/thom311/libnl/pull/266
|
|\
| |
| |
| | |
https://github.com/thom311/libnl/pull/267
|
| |
| |
| |
| | |
Signed-off-by: Leonard Crestez <cdleonard@gmail.com>
|
|/
|
|
|
|
|
| |
This has been defined in linux for a long time but libnl does not show
it.
Signed-off-by: Leonard Crestez <cdleonard@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Analogous to the dump request for states this data structure is
unnecessary for policy dumps, too. Unlike with states it does however
not create an error message.
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
https://github.com/thom311/libnl/pull/249
|
| |
|