This changes bsd/net.cc to enables netlink by registering netlink
domain and calling netlink_init().
It also adds a unit test to verify the netlink implementation.
Signed-off-by: Waldemar Kozaczuk
---
bsd/net.cc | 5 +
modules/tests/Makefile | 3 +-
tests/tst-netlink.c| 441
The netlink specfication requires that error field contains a negative
value of errno.
Signed-off-by: Waldemar Kozaczuk
---
bsd/sys/compat/linux/linux_netlink.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bsd/sys/compat/linux/linux_netlink.cc
b/bsd/sys/compat/linux/linu
Signed-off-by: Waldemar Kozaczuk
---
bsd/sys/compat/linux/linux_netlink.cc | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/bsd/sys/compat/linux/linux_netlink.cc
b/bsd/sys/compat/linux/linux_netlink.cc
index 180d81b5..be9ea1b8 100644
--- a/bsd/sys/compat/linux/linux_ne
There are three types of pid used in netlink interface:
- the nl_pid on the source (app) side (part of sockaddr_nl) set before
bind(); could be 0 to request kernel generating new one
- the nl_pid on the destination (kernel) size set into dst_addr that
always needs to be 0 if we communicate with
Fix netlink_process_msg() to propagate potential error
from netlink_senderr(). Normally netlink_senderr() should return
0 indicating that the error response was built successfully.
This patch tweaks the logic to make sure the error response
in such case is sent back as a NLMSG_ERROR reply according
This enhances the netlink_attach() to capture or generate the source
nl_pid (if 0) and save it in the control back that could be fetched later when
necessary. This will be useful in the next patch.
Signed-off-by: Waldemar Kozaczuk
---
bsd/sys/compat/linux/linux_netlink.cc | 25 ++
This is a minor adjustment to make OSv implementation match what Linux
does - skip IFA_BROADCAST attributes for loopback address in NEWADDR
response.
Signed-off-by: Waldemar Kozaczuk
---
bsd/sys/compat/linux/linux_netlink.cc | 14 ++
1 file changed, 10 insertions(+), 4 deletions(-)
Golang uses the netlink interface RTM_GETADDR to query the network interfaces
and IPs.
It assumes that the 1st attribute in the RTM_NEWADDR response is IFA_ADDRESS.
This
patch changes the order in which RTM_NEWADDR attributes are sent to make
sure the IFA_ADDRESS goes first and IFA_LABEL last.
T
This patch fixes a minor bug in handling RTM_GETADDR and RTM_GETNEIGH
requests. It tweaks the relevant code to set the RTM_NEWADDR and RTM_NEWNEIGH
type for the responses respectively.
This is important as for example Golang runtime tests the nlmsg_type of
the netlink response and breaks if it is
This 1st of the 10 patches brings support of the minimal subset of
the rtnetlink (Linux routing socket) interface as described here -
https://man7.org/linux/man-pages/man7/rtnetlink.7.html.
The rtnetlink is actually a subset of even richer netlink interface
described here - https://man7.org/linux/m
10 matches
Mail list logo