| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
inet_ntop() is documented to fail, so we have various places
with pointless (and wrong) error checking. Well, it can fail
if we pass an unexpected address family (which we must not and
assert against that), or if we pass an invalid string buffer (which we
must not, and cannot meaningfully assert for that). So it can only fail
in case of a bug and there is no need for error checking.
Yes, libc could theoretically fail, but if it fails on such a function that
requires no memory allocation, then it really needs to be fixed.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The kernel bridge now support (permanent) forwarding of MAC multicast
using the MDB. Internally the kernel use AF_UNSPEC, but we remap this
here to AF_LLC for the benefit for nl_addrs.
To test, put `nl-monitor mdb` in the background. Then, with a bridge
and at least one port, run the following command:
# nl-monitor mdb &
# bridge mdb add dev br0 port eth0 grp 01:02:03:c0:ff:ee vid 1 permanent
dev 9
port 3 vid 1 proto 0x0000 address 01:02:03:c0:ff:ee
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds support for the new VLAN_FLAG_BRIDGE_BINDING, for VLAN interfaces
created on top of a VLAN aware bridge. For details, see the kernel
patch:
https://lore.kernel.org/netdev/20190418173535.22925-1-mmanning@vyatta.att-mail.com/
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
https://github.com/thom311/libnl/pull/303
|
| |
|
|
|
|
| |
io_refcnt
|
|
|
|
|
|
| |
We have a base-set of tools, under netlink-private. It should not be
necessary to include all the bits individually. Just drag this all in.
Only downside is that the compiler has more to parse.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Closing an invalid filedescriptor is a serious bug, because we need to
know whether an integer at hand is valid or not (cannot close arbitrary
files). Add _nl_close() wrapper, which asserts against EBADF.
|
| |
|
| |
|
|
|
|
| |
Minimize the padding inthe struct.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds a subset of functions.
Implemented api:
rtnl_flower_set_proto;
rtnl_flower_get_proto;
rtnl_flower_set_vlan_id;
rtnl_flower_get_vlan_id;
rtnl_flower_set_vlan_prio;
rtnl_flower_get_vlan_prio;
rtnl_flower_set_vlan_ethtype;
rtnl_flower_set_dst_mac;
rtnl_flower_get_dst_mac;
rtnl_flower_set_src_mac;
rtnl_flower_get_src_mac;
rtnl_flower_set_ip_dscp;
rtnl_flower_get_ip_dscp;
rtnl_flower_set_flags;
rtnl_flower_append_action;
rtnl_flower_del_action;
rtnl_flower_get_action;
[thaller@redhat.com: squashed commit "route:cls:flower: use parentheses in
macro definitions"]
[thaller@redhat.com: squashed commit "cls:flower: add TCA_FLOWER_FLAGS
to flower_policy"]
[thaller@redhat.com: squashed commit "cls:flower: vlan priority is
uint8_t, not uint16_t"]
[thaller@redhat.com: squashed commit "route:cls:flower: substitute nl_data*
with uint8_t mac[ETH_ALEN]"]
[thaller@redhat.com: drop non-existing TCA_FLOWER_POLICE. That was
never merged to upstream kernel. While at it, use decimal numbers
for the bitshift.]
[thaller@redhat.com: fix build by including <linux/if_ether.h> in
"types.h".]
Signed-off-by: Volodymyr Bendiuga <volodymyr.bendiuga@westermo.se>
|
|
|
|
|
|
| |
The argument of the setters does not get modified. Make it const.
This change does not break API/ABI.
|
|
|
|
|
| |
In can_put_attrs(), we also put ci_data_bittiming_const. It is thus
necessary to be able to set it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These accessor functions just get/set a field of ci_data_bittiming,
which can already be get/set as a whole. It seems redundant, so drop it.
It's really important that things are principle at all (like, setting
ci_data_bittiming). It's not clear that we need such convenience
functions, if you can achieve the same result otherwise.
Yes, we have similar accessors already. I think that is not a good
approach though.
If they turn out very useful, we can still revert this patch.
|
|
|
|
|
|
| |
rtnl_link_can_get_data_bittiming_const()
It seems more consistent with the other names.
|
| |
|
|
|
|
|
|
|
| |
Add CAN FD support analog to the normal CAN support.
[thaller@redhat.com: second part of original commit. The first
part was merged as commit 5d925168a459]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- a `struct rtnl_mdb` has a list of `struct rtnl_mdb_entry`.
An attribute like MDB_ATTR_PORT is not really an attribute
of the MDB struct, but rather of one entry. It makes no sense
to mangle these. Having MDB_ATTR_PORT set in the change flags
would mean that at least one entry has the port set.
Instead, add MDB_ATTR_ENTRIES which is about the list of entries.
- drop unused `ce_mask` in `struct rtnl_mdb_entry`.
- rework mdb_compare(). When we compare the two lists of entries,
it's not right to have two nested loops. You can either
iterate both lists in step, and compare each element to do
a comparison that honors the order of the elements. Or, you
can compare the two lists accepting any order. The latter
is more complicated, and does not seem right. So do the former.
|
|
|
|
|
|
|
|
|
|
|
| |
"struct rtnl_mdb_entry" is a relatively simple object that keeps a few
data fields. But there are no public setters in the API, so it's not
useful to be able to allocate such an entry.
Hide from public API.
Also, it was already not listed in libnl-route-3.sym, and thus the
symbol was hidden anyway.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- drop leading tabs. Yes, it's inside an extern C block, but so is all
our code in public headers. That should not by default increase the
indentation level.
- drop unused rtnl_mdb_add().
- forward declare "struct rtnl_mdb".
|
|
|
|
|
|
|
|
|
|
|
| |
The Linux kernel has a notification system via Netlink that reports the
changes in the multicast database over the RTNLGRP_MDB multicast socket.
As such notifications such as RTM_NEWMDB, RTM_GETMDB can be processed in
userspace.
libnl must support the capability of processing these messages, e.g.
RTM_GETMDB.
This commit adds a new rtnl_mdb object as well as a route/mdb cache,
in order to expose the contents of the multicast database.
|
|
|
|
|
|
|
| |
rtnl_cls_find_by{handle,prio}()
The functions return the first matching object (of potentially several).
Rename them to "find", so that this is a bit clearer.
|
|
|
|
|
|
|
|
| |
API:
rtnl_cls_get()
rtnl_cls_get_by_prio()
These functions search for classifiers in classifier cache.
|
| |
|
|
|
|
|
|
| |
This is a new option that was added in Linux v4.12.
Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
|
|
|
|
|
|
| |
This is a new option that was added in Linux v4.12.
Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
|
|
|
|
|
|
| |
This is a new option that was added in Linux v4.12.
Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
|
|
|
|
|
|
| |
This is a new option that was added in Linux v4.12.
Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
|
|
|
|
|
|
| |
This is a new option that was added in Linux v4.12.
Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
|
|
|
|
|
|
| |
This is a new option that was added in Linux v4.12.
Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
|
|
|
|
|
|
| |
This is a new option that was added in Linux v4.12.
Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
|
|
|
|
|
|
|
| |
This patch adds support for IPv6 VTI tunneling
that uses the vti6 kernel module.
Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
|
| |
|
|
|
|
|
|
|
| |
Using the flnl_* family of functions to perform FIB lookups is rather
limited. In particular, there seems to be no way of resolving the
nexthop. By hooking into RTM_GETROUTE, a regular rtnl route object is
returned instead.
|
|
|
|
| |
Signed-off-by: Jonas Johansson <jonas.johansson@westermo.se>
|
|
|
|
|
|
|
|
|
|
|
|
| |
API:
rtnl_qdisc_get_by_kind()
This function allows getting qdisc based on
its kind, i.e. tbf, htb, cbq, etc.
Signed-off-by: Volodymyr Bendiuga <volodymyr.bendiuga@westermo.se>
https://github.com/thom311/libnl/pull/244
|
|
|
|
| |
Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
|
|
|
|
| |
Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
|
|
|
|
| |
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
|