public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta•com>
To: Stephen Hemminger <shemminger@vyatta•com>
Cc: Shan Wei <shanwei88@gmail•com>,
	xemul@parallels•com, NetDev <netdev@vger•kernel.org>
Subject: [PATCH] unix_diag: use netlink attribute MAX convention
Date: Wed, 25 Apr 2012 10:38:58 -0700	[thread overview]
Message-ID: <20120425103858.04d149d8@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <20120425092645.180ac196@nehalam.linuxnetplumber.net>

Use the standard convention to define the number of elements
in unix diag attribute. This fixes future problems like the fact
the last element (MEMINFO) is not parsed by current iproute2 ss command.

Signed-off-by: Stephen Hemminger <shemminger@vyatta•com>

--- a/include/linux/unix_diag.h	2012-02-13 09:23:58.830508614 -0800
+++ b/include/linux/unix_diag.h	2012-04-25 09:36:20.752056963 -0700
@@ -37,9 +37,9 @@ enum {
 	UNIX_DIAG_ICONS,
 	UNIX_DIAG_RQLEN,
 	UNIX_DIAG_MEMINFO,
-
-	UNIX_DIAG_MAX,
+	__UNIX_DIAG_MAX
 };
+#define UNIX_DIAG_MAX (__UNIX_DIAG_MAX - 1)
 
 struct unix_diag_vfs {
 	__u32	udiag_vfs_ino;

  reply	other threads:[~2012-04-25 17:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-25  7:15 [PATCH 1/2] ss: fix the incorrect value of total UNIX_DIAG_* number Shan Wei
2012-04-25 16:26 ` Stephen Hemminger
2012-04-25 17:38   ` Stephen Hemminger [this message]
2012-04-25 18:16     ` [PATCH] unix_diag: use netlink attribute MAX convention David Miller
2012-04-25 18:56       ` Stephen Hemminger
2012-04-25 19:07         ` David Miller
2012-04-25 19:47           ` Stephen Hemminger
2012-04-25 19:57             ` David Miller
2012-04-25 20:09               ` Stephen Hemminger
2012-04-25 20:12                 ` David Miller
2012-04-25 20:21 ` [PATCH 1/2] ss: fix the incorrect value of total UNIX_DIAG_* number Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120425103858.04d149d8@nehalam.linuxnetplumber.net \
    --to=shemminger@vyatta$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=shanwei88@gmail$(echo .)com \
    --cc=xemul@parallels$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox