<feed xmlns='http://www.w3.org/2005/Atom'>
<title>passt, branch bug205</title>
<subtitle>Plug A Simple Socket Transport</subtitle>
<link rel='alternate' type='text/html' href='https://passt.top/passt/'/>
<entry>
<title>fwd_rule: Allow parsing * as a forwarding address</title>
<updated>2026-05-15T05:34:04+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2026-05-15T05:34:04+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=c41360d2bf6999301196b69b7802e30412d3d203'/>
<id>c41360d2bf6999301196b69b7802e30412d3d203</id>
<content type='text'>
In our output in various places, we use "*", or sometimes "[*]" to indicate
a dual stack unspecified address: that is a case where we listen on both
0.0.0.0 and ::.  However we don't currently allow the same syntax when
specifying forwarding rules on the command line.

A * address can be indirectly specified by omitting the address entirely,
but for consistency allow an explicit "*" or "[*]" as well.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In our output in various places, we use "*", or sometimes "[*]" to indicate
a dual stack unspecified address: that is a case where we listen on both
0.0.0.0 and ::.  However we don't currently allow the same syntax when
specifying forwarding rules on the command line.

A * address can be indirectly specified by omitting the address entirely,
but for consistency allow an explicit "*" or "[*]" as well.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fwd_rule: Don't attempt dual stack listen()s if only one IP family</title>
<updated>2026-05-15T05:27:35+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2026-05-15T05:27:35+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=bc6c909ef1fcd51b42492a523c417c7cab60d72b'/>
<id>bc6c909ef1fcd51b42492a523c417c7cab60d72b</id>
<content type='text'>
With the recent rework to forwarding configuration, we're stricter about
what forwarding rules we allow.  In particular we don't allow dual stack
forwards (listening on both IPv4 and IPv6 addresses) if we only have one
IP family enabled.

This makes what I think was a pre-existing minor bug into a nasty failure.
If we use default forwards with no address specified, e.g.:
    $ pasta -t 1234 -4
    $ pasta -U 4321 -6
these are interpreted as dual-stack forwards.  Previously these would be
applied, leading to a surprising dual stack socket.  Since 0aeda87ca185,
they instead result in an immediate fatal error.

Add logic to interpret a default "any" address as only one IP family if
only one IP family is enabled.

Link: https://bugs.passt.top/show_bug.cgi?id=205
Reported-by: &lt;j.d03@cpc.cx&gt;
Fixes: 0aeda87ca185 ("conf, fwd: Stricter rule checking in fwd_rule_add()")
Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With the recent rework to forwarding configuration, we're stricter about
what forwarding rules we allow.  In particular we don't allow dual stack
forwards (listening on both IPv4 and IPv6 addresses) if we only have one
IP family enabled.

This makes what I think was a pre-existing minor bug into a nasty failure.
If we use default forwards with no address specified, e.g.:
    $ pasta -t 1234 -4
    $ pasta -U 4321 -6
these are interpreted as dual-stack forwards.  Previously these would be
applied, leading to a surprising dual stack socket.  Since 0aeda87ca185,
they instead result in an immediate fatal error.

Add logic to interpret a default "any" address as only one IP family if
only one IP family is enabled.

Link: https://bugs.passt.top/show_bug.cgi?id=205
Reported-by: &lt;j.d03@cpc.cx&gt;
Fixes: 0aeda87ca185 ("conf, fwd: Stricter rule checking in fwd_rule_add()")
Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clang-tidy: Suppress some new unhelpful new warnings</title>
<updated>2026-05-11T22:04:11+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2026-05-11T10:03:22+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=4de7c3826d810e2e3f7f404dc8037ab445d6f2f0'/>
<id>4de7c3826d810e2e3f7f404dc8037ab445d6f2f0</id>
<content type='text'>
clang-tidy 22.1.4 (or thereabouts) introduced some new warning categories
that while theoretically useful, trip in too many silly occasions to be
useful.  Suppress them.

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 22.1.4 (or thereabouts) introduced some new warning categories
that while theoretically useful, trip in too many silly occasions to be
useful.  Suppress them.

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>treewide: Make some additional variables static</title>
<updated>2026-05-11T22:04:08+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2026-05-11T10:03:21+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=97e478b40d4154cf007641f1e247cc3fef8392ad'/>
<id>97e478b40d4154cf007641f1e247cc3fef8392ad</id>
<content type='text'>
Mark a number of extra variables local to a single module as static.

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>
Mark a number of extra variables local to a single module as static.

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>packet, clang-tidy: Packet pool buffers are not NULL</title>
<updated>2026-05-11T22:04:06+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2026-05-11T10:03:20+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=90f175d82dabfa564122e98949f5abb5590d89d1'/>
<id>90f175d82dabfa564122e98949f5abb5590d89d1</id>
<content type='text'>
struct pool always needs a non-NULL buf field: it points either to the
actual memory used to store packets, or for vhost-user to the vhost user
memory structure which will contain the packets.  We set this pointer
when we initialise the pool.  However, clang-tidy (as of 22.1.4, at least)
doesn't realise this in packet_check_range(), causing UB warnings due to
the subtraction of ptr and p-&gt;buf.

Clue it in with an assert().

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>
struct pool always needs a non-NULL buf field: it points either to the
actual memory used to store packets, or for vhost-user to the vhost user
memory structure which will contain the packets.  We set this pointer
when we initialise the pool.  However, clang-tidy (as of 22.1.4, at least)
doesn't realise this in packet_check_range(), causing UB warnings due to
the subtraction of ptr and p-&gt;buf.

Clue it in with an assert().

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>clang-tidy: Suppress sscanf() warning harder</title>
<updated>2026-05-11T22:04:05+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2026-05-11T10:03:19+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=7bafe7163ab0bfafc3d90dcba06c1b045b57a285'/>
<id>7bafe7163ab0bfafc3d90dcba06c1b045b57a285</id>
<content type='text'>
We already have a clang-tidy suppression to stop if complaining about our
use of sscanf() in procfs_scan_listen().  However, it now (clang-tidy
22.1.4 or thereabouts) seems there's an additional warning category that
complains about the same thing.  Add that to the suppression.

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>
We already have a clang-tidy suppression to stop if complaining about our
use of sscanf() in procfs_scan_listen().  However, it now (clang-tidy
22.1.4 or thereabouts) seems there's an additional warning category that
complains about the same thing.  Add that to the suppression.

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>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>conf: Fix not-actually-const parameter to conf_runas() and conf_ugid()</title>
<updated>2026-05-11T22:03:59+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2026-05-11T10:03:17+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=db02221ceee1ec01d74ed15d5d5e2d8997c54f51'/>
<id>db02221ceee1ec01d74ed15d5d5e2d8997c54f51</id>
<content type='text'>
Commit 4af3d83170fd changed the @opt parameter to conf_runas() to a const
pointer, to remove a cppcheck error.  However, that error was a false
positive.  We *do* modify that parameter via an aliased pointer within it
retreived from strchr().  At least with gcc 16.1.1 that now causes a
"discards const" warning.  Revert that change and instead directly suppress
the cppcheck warning.

Fixes: 4af3d83170fd ("treewide: Fix more pointers which can be const")
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>
Commit 4af3d83170fd changed the @opt parameter to conf_runas() to a const
pointer, to remove a cppcheck error.  However, that error was a false
positive.  We *do* modify that parameter via an aliased pointer within it
retreived from strchr().  At least with gcc 16.1.1 that now causes a
"discards const" warning.  Revert that change and instead directly suppress
the cppcheck warning.

Fixes: 4af3d83170fd ("treewide: Fix more pointers which can be const")
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>virtio: Reduce scope of variable</title>
<updated>2026-05-11T22:03:57+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2026-05-11T10:03:16+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=5b3ca87079e7a356ba0036ebb0be0a37def35e38'/>
<id>5b3ca87079e7a356ba0036ebb0be0a37def35e38</id>
<content type='text'>
As cppcheck points out, the 'min' variable in vu_log_queue_fill() can have
its scope reduced.  Do so.

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>
As cppcheck points out, the 'min' variable in vu_log_queue_fill() can have
its scope reduced.  Do so.

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>
