netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2-next 0/5] ipnetns: cleanup and harden processing of netns ids
@ 2019-11-08 17:00 Guillaume Nault
  2019-11-08 17:00 ` [PATCH iproute2-next 1/5] ipnetns: treat NETNSA_NSID and NETNSA_CURRENT_NSID as signed Guillaume Nault
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Guillaume Nault @ 2019-11-08 17:00 UTC (permalink / raw)
  To: David Ahern; +Cc: netdev, Nicolas Dichtel

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(-)

-- 
2.21.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-11-09  1:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-08 17:00 [PATCH iproute2-next 0/5] ipnetns: cleanup and harden processing of netns ids Guillaume Nault
2019-11-08 17:00 ` [PATCH iproute2-next 1/5] ipnetns: treat NETNSA_NSID and NETNSA_CURRENT_NSID as signed Guillaume Nault
2019-11-08 17:00 ` [PATCH iproute2-next 2/5] ipnetns: fix misleading comment about 'ip monitor nsid' Guillaume Nault
2019-11-08 17:00 ` [PATCH iproute2-next 3/5] ipnetns: harden helper functions wrt. negative netns ids Guillaume Nault
2019-11-08 17:00 ` [PATCH iproute2-next 4/5] ipnetns: don't print unassigned nsid in json export Guillaume Nault
2019-11-08 17:00 ` [PATCH iproute2-next 5/5] ipnetns: remove blank lines printed by invarg() messages Guillaume Nault
2019-11-09  1:36 ` [PATCH iproute2-next 0/5] ipnetns: cleanup and harden processing of netns ids David Ahern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).