<feed xmlns='http://www.w3.org/2005/Atom'>
<title>passt/netlink.c, branch 2026_12_04.a39d958</title>
<subtitle>Plug A Simple Socket Transport</subtitle>
<link rel='alternate' type='text/html' href='https://passt.top/passt/'/>
<entry>
<title>netlink: Only consider gateway from the selected template interface</title>
<updated>2026-12-04T21:54:33+00:00</updated>
<author>
<name>Benjamin Schubert</name>
<email>bschubert15@bloomberg.net</email>
</author>
<published>2026-12-04T15:06:10+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=a39d958da8eb1ca6b582648f328408623f0a04e4'/>
<id>a39d958da8eb1ca6b582648f328408623f0a04e4</id>
<content type='text'>
Previously, netlink could select a gateway from a different interface
if it had higher weights than the one from the selected interface.

This can lead to a namespace having an unreachable default gateway.

This considers only nexthops from the current interface instead of all
interfaces when looking at the template interface, ensuring that the ip
and the gateway are always aligned.

Link: https://bugs.passt.top/show_bug.cgi?id=232
Fixes: 6c7623d07bbd ("netlink: Add support to fetch default gateway from multipath routes")
Signed-off-by: Benjamin Schubert &lt;bschubert15@bloomberg.net&gt;
[sbrivio: Minor man page edit for clarity, 198.51.100.0/24 in tests]
Reviewed-by: Jon Maloy &lt;jmaloy@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, netlink could select a gateway from a different interface
if it had higher weights than the one from the selected interface.

This can lead to a namespace having an unreachable default gateway.

This considers only nexthops from the current interface instead of all
interfaces when looking at the template interface, ensuring that the ip
and the gateway are always aligned.

Link: https://bugs.passt.top/show_bug.cgi?id=232
Fixes: 6c7623d07bbd ("netlink: Add support to fetch default gateway from multipath routes")
Signed-off-by: Benjamin Schubert &lt;bschubert15@bloomberg.net&gt;
[sbrivio: Minor man page edit for clarity, 198.51.100.0/24 in tests]
Reviewed-by: Jon Maloy &lt;jmaloy@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netlink: Ignore routes via gateways from another address family</title>
<updated>2026-12-04T21:54:12+00:00</updated>
<author>
<name>Jon Maloy</name>
<email>jmaloy@redhat.com</email>
</author>
<published>2026-12-03T15:04:41+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=71ee9ecf920cc2b63f5ff4d8d05c2c32ae1241ed'/>
<id>71ee9ecf920cc2b63f5ff4d8d05c2c32ae1241ed</id>
<content type='text'>
With NetworkManager's CLAT implementation, the IPv4 default route has
an IPv6 gateway, given in a RTA_VIA attribute instead of RTA_GATEWAY:

  default via inet6 fe80::1 dev wlp170s0f0 proto static src 192.0.0.5

nl_get_ext_if() picks the interface of that route as template for
IPv4, but nl_route_get_def() finds no IPv4 gateway, so we disable DHCP
altogether, and the guest silently ends up without IPv4 connectivity,
even if the host has it.

We can't pass a gateway of a different address family on to the guest,
so don't consider such routes in nl_get_ext_if(). If no other IPv4
routes are available, as in the case above, we fall back to local
mode, which gives the guest a working IPv4 configuration: traffic
still reaches the host via our sockets, and the host translates it.
The address we would otherwise copy, from 192.0.0.0/29 (RFC 7335), is
just a placeholder in CLAT setups anyway.

Link: https://bugs.passt.top/show_bug.cgi?id=231
Reported-by: Erica Z &lt;zerica@callcc.eu&gt;
Suggested-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Signed-off-by: Jon Maloy &lt;jmaloy@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With NetworkManager's CLAT implementation, the IPv4 default route has
an IPv6 gateway, given in a RTA_VIA attribute instead of RTA_GATEWAY:

  default via inet6 fe80::1 dev wlp170s0f0 proto static src 192.0.0.5

nl_get_ext_if() picks the interface of that route as template for
IPv4, but nl_route_get_def() finds no IPv4 gateway, so we disable DHCP
altogether, and the guest silently ends up without IPv4 connectivity,
even if the host has it.

We can't pass a gateway of a different address family on to the guest,
so don't consider such routes in nl_get_ext_if(). If no other IPv4
routes are available, as in the case above, we fall back to local
mode, which gives the guest a working IPv4 configuration: traffic
still reaches the host via our sockets, and the host translates it.
The address we would otherwise copy, from 192.0.0.0/29 (RFC 7335), is
just a placeholder in CLAT setups anyway.

Link: https://bugs.passt.top/show_bug.cgi?id=231
Reported-by: Erica Z &lt;zerica@callcc.eu&gt;
Suggested-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Signed-off-by: Jon Maloy &lt;jmaloy@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netlink: Fix gateway selection for multipath default routes</title>
<updated>2026-12-02T21:36:25+00:00</updated>
<author>
<name>Benjamin Schubert</name>
<email>bschubert15@bloomberg.net</email>
</author>
<published>2026-12-01T14:07:58+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=05d3780b82d858041f982a276db0de7167f8b661'/>
<id>05d3780b82d858041f982a276db0de7167f8b661</id>
<content type='text'>
The documentation of `--gateway` in `passt.1` states that
for a multipath default route, the first nexthop router returned
by the kernel with the highest weight is selected.

`nl_route_get_def_multipath()` however allowed a subsequent route with
the same weight to override the nexthop, so it was the last gateway
with a nexthop that would actually be chosen.

This aligns the code with the documentation, by fixing the code to
only select a new gateway if it has strictly a higher weight.

Also update the selected weight only after finding a gateway.
Since a device-only nexthop is not a gateway candidate, it must
not prevent a subsequent gateway from being selected.

Add 7 tests for various ipv4 and ipv6 scenarios with multipath
gateways. Note that ipv6 with no default gateway is not accepted by
the kernel, and thus ipv6 has one less test.
All 7 tests fail before this change.

Link: https://bugs.passt.top/show_bug.cgi?id=230
Signed-off-by: Benjamin Schubert &lt;bschubert15@bloomberg.net&gt;
[sbrivio: Fix typos in commit message]
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The documentation of `--gateway` in `passt.1` states that
for a multipath default route, the first nexthop router returned
by the kernel with the highest weight is selected.

`nl_route_get_def_multipath()` however allowed a subsequent route with
the same weight to override the nexthop, so it was the last gateway
with a nexthop that would actually be chosen.

This aligns the code with the documentation, by fixing the code to
only select a new gateway if it has strictly a higher weight.

Also update the selected weight only after finding a gateway.
Since a device-only nexthop is not a gateway candidate, it must
not prevent a subsequent gateway from being selected.

Add 7 tests for various ipv4 and ipv6 scenarios with multipath
gateways. Note that ipv6 with no default gateway is not accepted by
the kernel, and thus ipv6 has one less test.
All 7 tests fail before this change.

Link: https://bugs.passt.top/show_bug.cgi?id=230
Signed-off-by: Benjamin Schubert &lt;bschubert15@bloomberg.net&gt;
[sbrivio: Fix typos in commit message]
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netlink: Copy all routes in nl_route_dup(), not just the first batch</title>
<updated>2026-11-29T23:37:09+00:00</updated>
<author>
<name>Martin Schitter</name>
<email>ms+git@mur.at</email>
</author>
<published>2026-11-26T21:52:04+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=6c6a717277fd492ad9265439439b83967cbdfb1c'/>
<id>6c6a717277fd492ad9265439439b83967cbdfb1c</id>
<content type='text'>
The kernel splits large route dumps over several netlink datagrams, but
nl_route_dup() currently only processes the first one, and fails with
"Too many routes to duplicate" if there are more. This happens when
there are more than about 50 routes on the template interface.

Change the code so that all datagrams are processed. Routes are copied
to the destination namespace in three successive steps, to satisfy
dependencies between them:
- routes to local addresses
- routes to local networks
- routes with a gateway

This approach is inspired by the restore subcommand of iproute2.

Link: https://bugs.passt.top/show_bug.cgi?id=221
Signed-off-by: Martin Schitter &lt;ms+git@mur.at&gt;
[jmaloy: Keep stripping of RTA_PREFSRC and RTA_NH_ID, bounds check on
 attribute types, style fixes]
Signed-off-by: Jon Maloy &lt;jmaloy@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The kernel splits large route dumps over several netlink datagrams, but
nl_route_dup() currently only processes the first one, and fails with
"Too many routes to duplicate" if there are more. This happens when
there are more than about 50 routes on the template interface.

Change the code so that all datagrams are processed. Routes are copied
to the destination namespace in three successive steps, to satisfy
dependencies between them:
- routes to local addresses
- routes to local networks
- routes with a gateway

This approach is inspired by the restore subcommand of iproute2.

Link: https://bugs.passt.top/show_bug.cgi?id=221
Signed-off-by: Martin Schitter &lt;ms+git@mur.at&gt;
[jmaloy: Keep stripping of RTA_PREFSRC and RTA_NH_ID, bounds check on
 attribute types, style fixes]
Signed-off-by: Jon Maloy &lt;jmaloy@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netlink: Set default route as on-link</title>
<updated>2026-11-24T10:38:26+00:00</updated>
<author>
<name>Jon Maloy</name>
<email>jmaloy@redhat.com</email>
</author>
<published>2026-11-24T04:13:50+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=2b9de43e51ac789dce5872d5cfdba05376dad00c'/>
<id>2b9de43e51ac789dce5872d5cfdba05376dad00c</id>
<content type='text'>
Commit da54641f140e ("conf, pasta: With --config-net, copy all routes
by default") made it possible to use a default gateway that's not on
the same subnet as any address assigned to the namespace interface,
as copying all routes from the template interface also copies the
device route for the gateway.

If pasta sets the default route itself instead, that is, with -g or
--no-copy-routes, or in local mode, there's no such device route, and
the kernel refuses a gateway that's not covered by any assigned
prefix:

  $ pasta -Ix -- sh -c 'ip link set dev x up; \
      ip addr add 10.0.0.2/24 dev x; \
      ip route add default via 10.0.0.1 dev x; \
      pasta -4 --config-net -a 192.0.2.1 -g 10.0.0.1 -- ip route'
  Couldn't set IPv4 route(s) in guest: Network is unreachable

  $ pasta -6 -Ix -- sh -c 'ip link set dev x up; \
      ip addr add 2001:db8:1::2/64 dev x nodad; \
      ip -6 route add default via 2001:db8:1::1 dev x; \
      pasta -6 --config-net -a 2001:db8:2::1 -g 2001:db8:1::1 -- \
      ip -6 route'
  Couldn't set IPv6 route(s) in guest: No route to host

The same happens in local mode for IPv4, where the default gateway is
169.254.2.2, with -a and any address outside 169.254.0.0/16. In local
mode for IPv6, the default gateway is the link-local address fe80::1,
which is always covered by the fe80::/64 device route.

We reply to ARP requests and neighbour solicitations for any address
other than the guest's own, so the gateway is in fact always reachable
on the link. Flag the default route with RTNH_F_ONLINK, so that the
kernel doesn't require the gateway to be within an assigned prefix.
This doesn't hide anything from the user, and makes these
configurations usable. With this change:

  default via 10.0.0.1 dev x onlink
  192.0.2.0/24 dev x proto kernel scope link src 192.0.2.1

and:

  default via 2001:db8:1::1 dev x metric 1024 onlink pref medium

Note that RTNH_F_ONLINK is supported for IPv6 routes since Linux 4.16.

Signed-off-by: Jon Maloy &lt;jmaloy@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit da54641f140e ("conf, pasta: With --config-net, copy all routes
by default") made it possible to use a default gateway that's not on
the same subnet as any address assigned to the namespace interface,
as copying all routes from the template interface also copies the
device route for the gateway.

If pasta sets the default route itself instead, that is, with -g or
--no-copy-routes, or in local mode, there's no such device route, and
the kernel refuses a gateway that's not covered by any assigned
prefix:

  $ pasta -Ix -- sh -c 'ip link set dev x up; \
      ip addr add 10.0.0.2/24 dev x; \
      ip route add default via 10.0.0.1 dev x; \
      pasta -4 --config-net -a 192.0.2.1 -g 10.0.0.1 -- ip route'
  Couldn't set IPv4 route(s) in guest: Network is unreachable

  $ pasta -6 -Ix -- sh -c 'ip link set dev x up; \
      ip addr add 2001:db8:1::2/64 dev x nodad; \
      ip -6 route add default via 2001:db8:1::1 dev x; \
      pasta -6 --config-net -a 2001:db8:2::1 -g 2001:db8:1::1 -- \
      ip -6 route'
  Couldn't set IPv6 route(s) in guest: No route to host

The same happens in local mode for IPv4, where the default gateway is
169.254.2.2, with -a and any address outside 169.254.0.0/16. In local
mode for IPv6, the default gateway is the link-local address fe80::1,
which is always covered by the fe80::/64 device route.

We reply to ARP requests and neighbour solicitations for any address
other than the guest's own, so the gateway is in fact always reachable
on the link. Flag the default route with RTNH_F_ONLINK, so that the
kernel doesn't require the gateway to be within an assigned prefix.
This doesn't hide anything from the user, and makes these
configurations usable. With this change:

  default via 10.0.0.1 dev x onlink
  192.0.2.0/24 dev x proto kernel scope link src 192.0.2.1

and:

  default via 2001:db8:1::1 dev x metric 1024 onlink pref medium

Note that RTNH_F_ONLINK is supported for IPv6 routes since Linux 4.16.

Signed-off-by: Jon Maloy &lt;jmaloy@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netlink: Don't warn about multiple interfaces when there's only one</title>
<updated>2026-09-01T15:04:35+00:00</updated>
<author>
<name>Hayato Kiwata</name>
<email>dev@haytok.jp</email>
</author>
<published>2026-08-22T08:48:56+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=7e8d49b8a6b501b9eb9caf44cf1f653fd2a385b5'/>
<id>7e8d49b8a6b501b9eb9caf44cf1f653fd2a385b5</id>
<content type='text'>
Suppose there is a single network interface on the host, with two
addresses of different prefixes assigned to it.

In this situation, running pasta to create an isolated netns prints
"Multiple interfaces with %s routes, picked first", even though there
is in fact only one candidate interface.

Reproducer:

  sudo ip link add dummy42 type dummy
  sudo ip link set dev dummy42 up
  sudo ip addr add fdaa:aaaa:aaaa::1/64 dev dummy42
  sudo ip addr add fdbb:bbbb:bbbb::1/64 dev dummy42

  pasta --config-net -- true

This message is meant to indicate that there are multiple candidate
interfaces, but in fact there is only one, which can mislead users.

Therefore, avoid printing this message when there are multiple non-default
routes that all belong to the same interface.

Fixes: 450a6131beab ("netlink: With no default route, pick the first interface with a route")
Signed-off-by: Hayato Kiwata &lt;dev@haytok.jp&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Suppose there is a single network interface on the host, with two
addresses of different prefixes assigned to it.

In this situation, running pasta to create an isolated netns prints
"Multiple interfaces with %s routes, picked first", even though there
is in fact only one candidate interface.

Reproducer:

  sudo ip link add dummy42 type dummy
  sudo ip link set dev dummy42 up
  sudo ip addr add fdaa:aaaa:aaaa::1/64 dev dummy42
  sudo ip addr add fdbb:bbbb:bbbb::1/64 dev dummy42

  pasta --config-net -- true

This message is meant to indicate that there are multiple candidate
interfaces, but in fact there is only one, which can mislead users.

Therefore, avoid printing this message when there are multiple non-default
routes that all belong to the same interface.

Fixes: 450a6131beab ("netlink: With no default route, pick the first interface with a route")
Signed-off-by: Hayato Kiwata &lt;dev@haytok.jp&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netlink: Fix comments to variables for netlink sockets and sequence</title>
<updated>2026-05-26T10:15:31+00:00</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2026-05-21T17:52:34+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=5038f925b028f2faa401b3210327c1de1a24e84b'/>
<id>5038f925b028f2faa401b3210327c1de1a24e84b</id>
<content type='text'>
Commit 3c469013cfaa ("netlink: add subscription on changes in NDP/ARP
table") added the descriptor for the new socket, int nl_sock_neigh,
next to the variables for the existing sockets, without updating the
comment, and before the variable reserved for the sequence number.

That seems to suggest that the sequence number applies to the notifier
socket as well, but that's not the case. Further, the comment didn't
match anymore.

Move the variable declaration for nl_sock_neigh below, and add a
separate comment for it, actually describing it. While at it, fix the
indentation.

Fixes: 3c469013cfaa ("netlink: add subscription on changes in NDP/ARP table")
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 3c469013cfaa ("netlink: add subscription on changes in NDP/ARP
table") added the descriptor for the new socket, int nl_sock_neigh,
next to the variables for the existing sockets, without updating the
comment, and before the variable reserved for the sequence number.

That seems to suggest that the sequence number applies to the notifier
socket as well, but that's not the case. Further, the comment didn't
match anymore.

Move the variable declaration for nl_sock_neigh below, and add a
separate comment for it, actually describing it. While at it, fix the
indentation.

Fixes: 3c469013cfaa ("netlink: add subscription on changes in NDP/ARP table")
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netlink: Use regular request/response netlink socket for initial neighbour sync</title>
<updated>2026-05-26T09:51:41+00:00</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2026-05-21T17:00:51+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=d00255bd3ccc3b19099fb34ab278b06d6be2ca59'/>
<id>d00255bd3ccc3b19099fb34ab278b06d6be2ca59</id>
<content type='text'>
...instead of the one dedicated to the neighbour monitor, because, if
neighbour notifications start coming in before or while we send the
initial request to read out the neighbour tables, messages and
sequence numbers will collide.

For example, if nl_neigh_sync() sends a RTM_GETNEIGH request with
sequence 20, we expect a corresponding reply with sequence 20. But
given that we already used the same socket to subscribe to
notifications, and notifications don't correspond to any specific
request we sent, we might now get a message with sequence 0.

The collision between messages wouldn't actually matter, as we'll
handle anyway any RTM_NEWNEIGH message in the same fashion, but we
need to validate sequence numbers for robustness, and that will fail.

At the same time, we have to subscribe to neighbour notifications
before calling nl_neigh_sync(), because we'll have a race condition
otherwise, as we might miss neighbours that were added before the
notifier is registered.

Use the regular nl_sock for nl_neigh_sync().

Drop the interface index from the request: we won't get any entry
otherwise, because the Linux kernel (as of version 7.0) is unable to
filter on it. Results are now filtered by interface index as we read
them.

Passing along an interface index used to work when nl_neigh_sync()
used the notifier socket, because NETLINK_GET_STRICT_CHK is not set
on it, meaning that results weren't filtered at all (interface and
IP version passed in the request were ignored altogether).

To reproduce the issue fixed here:

* detach a network and user namespace:

  [terminal 0]
  $ unshare -rUn
  # echo $$
  1543307

* attach pasta to it:

  [terminal 1]
  $ ./pasta -f --config-net 1543307 -I enp9s0

* enter that namespace from yet another terminal:

  [terminal 2]
  $ nsenter --preserve-credentials -U -n -t 1543307

* start flooding the MAC address table of this namespace:

  [terminal 1]
  # for i in $(seq 10 99); do for j in $(seq 10 99); do for k in $(seq 10 99); do ip ne add dev enp9s0 10.$i.$j.$k lladdr 00:11:22:$i:$j:$k; done; done; done

* and now start another instance of pasta in this namespace:

  [terminal 2]
  # ./pasta -d --config-net

which will eventually result in pasta exiting with a message like:

  0.0253: netlink: Unexpected sequence number (0 != 34)

Reported-by: Paul Holzinger &lt;pholzing@redhat.com&gt;
Link: https://bugs.passt.top/show_bug.cgi?id=203
Fixes: 3c469013cfaa ("netlink: add subscription on changes in NDP/ARP table")
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
...instead of the one dedicated to the neighbour monitor, because, if
neighbour notifications start coming in before or while we send the
initial request to read out the neighbour tables, messages and
sequence numbers will collide.

For example, if nl_neigh_sync() sends a RTM_GETNEIGH request with
sequence 20, we expect a corresponding reply with sequence 20. But
given that we already used the same socket to subscribe to
notifications, and notifications don't correspond to any specific
request we sent, we might now get a message with sequence 0.

The collision between messages wouldn't actually matter, as we'll
handle anyway any RTM_NEWNEIGH message in the same fashion, but we
need to validate sequence numbers for robustness, and that will fail.

At the same time, we have to subscribe to neighbour notifications
before calling nl_neigh_sync(), because we'll have a race condition
otherwise, as we might miss neighbours that were added before the
notifier is registered.

Use the regular nl_sock for nl_neigh_sync().

Drop the interface index from the request: we won't get any entry
otherwise, because the Linux kernel (as of version 7.0) is unable to
filter on it. Results are now filtered by interface index as we read
them.

Passing along an interface index used to work when nl_neigh_sync()
used the notifier socket, because NETLINK_GET_STRICT_CHK is not set
on it, meaning that results weren't filtered at all (interface and
IP version passed in the request were ignored altogether).

To reproduce the issue fixed here:

* detach a network and user namespace:

  [terminal 0]
  $ unshare -rUn
  # echo $$
  1543307

* attach pasta to it:

  [terminal 1]
  $ ./pasta -f --config-net 1543307 -I enp9s0

* enter that namespace from yet another terminal:

  [terminal 2]
  $ nsenter --preserve-credentials -U -n -t 1543307

* start flooding the MAC address table of this namespace:

  [terminal 1]
  # for i in $(seq 10 99); do for j in $(seq 10 99); do for k in $(seq 10 99); do ip ne add dev enp9s0 10.$i.$j.$k lladdr 00:11:22:$i:$j:$k; done; done; done

* and now start another instance of pasta in this namespace:

  [terminal 2]
  # ./pasta -d --config-net

which will eventually result in pasta exiting with a message like:

  0.0253: netlink: Unexpected sequence number (0 != 34)

Reported-by: Paul Holzinger &lt;pholzing@redhat.com&gt;
Link: https://bugs.passt.top/show_bug.cgi?id=203
Fixes: 3c469013cfaa ("netlink: add subscription on changes in NDP/ARP table")
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clang-tidy: Squash inconsistent brace warnings in foreach macros</title>
<updated>2026-05-11T22:04:03+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2026-05-11T10:03:18+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=a82a2173d4ea41fe4e97d9451f8ed1626b00d612'/>
<id>a82a2173d4ea41fe4e97d9451f8ed1626b00d612</id>
<content type='text'>
clang-tidy, at least as of 22.1.4 complains about if/else statements with
inconsistent braces.  We generally do want consistend bracing per our
coding style.  However, some of our foreach macros generate inconsistent
bracing in a way that can't really be avoided.  Add suppressions to stop
clang-tidy complaining about these.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Reviewed-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
clang-tidy, at least as of 22.1.4 complains about if/else statements with
inconsistent braces.  We generally do want consistend bracing per our
coding style.  However, some of our foreach macros generate inconsistent
bracing in a way that can't really be avoided.  Add suppressions to stop
clang-tidy complaining about these.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Reviewed-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netlink: erromsg should be const in nl_status()</title>
<updated>2026-05-11T22:03:02+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2026-05-11T10:03:15+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=1e6b638b490918386292e79efc8f62311e4a9f2f'/>
<id>1e6b638b490918386292e79efc8f62311e4a9f2f</id>
<content type='text'>
This pointer aliases part of the const nlmsghdr we're passed, so it should
be const.  While we're there, remove an unnecessary explicit cast
(NLMSG_DATA() returns a void *, which implicitly casts to anything).
This also removes a warning on cppcheck 2.20.0 and probably many other
versions.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Reviewed-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This pointer aliases part of the const nlmsghdr we're passed, so it should
be const.  While we're there, remove an unnecessary explicit cast
(NLMSG_DATA() returns a void *, which implicitly casts to anything).
This also removes a warning on cppcheck 2.20.0 and probably many other
versions.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Reviewed-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
