Skip to content

ipnetns: cleanup and harden processing of netns ids

Guillaume Nault netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5ipnetns: treat NETNSA_NSID and NETNSA_CURRENT_NSID as signedip/ipnetns.c+7 -80 replies
2/5ipnetns: fix misleading comment about 'ip monitor nsid'ip/ipnetns.c+1 -10 replies
3/5ipnetns: harden helper functions wrt. negative netns idsip/ipnetns.c+12 -20 replies
4/5ipnetns: don't print unassigned nsid in json exportip/ipnetns.c+3 -30 replies
5/5ipnetns: remove blank lines printed by invarg() messagesip/ipnetns.c+6 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH iproute2-next 0/5] ipnetns: cleanup and harden processing of netns ids

It's currently hard to review ipnetns. The netns ids are inconsistently treated as signed or unsigned and most helper functions aren't prepared to use negative ids.

Netns id attributes can be negative: NETNSA_NSID_NOT_ASSIGNED == -1. So let's consistently treat nsids as signed and also reject negative values in functions that are supposed to only handle assigned netns ids.

While there, let's drop the extra blank line generated by some command line parsing errors (patch 5/5).

Guillaume Nault (5):
ipnetns: treat NETNSA_NSID and NETNSA_CURRENT_NSID as signed
ipnetns: fix misleading comment about 'ip monitor nsid'
ipnetns: harden helper functions wrt. negative netns ids
ipnetns: don't print unassigned nsid in json export
ipnetns: remove blank lines printed by invarg() messages

 ip/ipnetns.c | 49 +++++++++++++++++++++++++++++--------------------
 1 file changed, 29 insertions(+), 20 deletions(-)
Signature · 1 line
2.21.0