All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulrich Weber <uweber@astaro.com>
To: shemminger@vyatta.com
Cc: netdev@vger.kernel.org
Subject: [PATCH] iproute2: display xfrm socket policy direction
Date: Mon, 13 Sep 2010 15:29:05 +0200	[thread overview]
Message-ID: <20100913132905.GA8366@babylon> (raw)


display socket policy direction

Signed-off-by: Ulrich Weber <uweber@astaro.com>
---
 ip/ipxfrm.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
index 78e1926..b3ff20b 100644
--- a/ip/ipxfrm.c
+++ b/ip/ipxfrm.c
@@ -861,7 +861,13 @@ void xfrm_policy_info_print(struct xfrm_userpolicy_info *xpinfo,
 	STRBUF_CAT(buf, "\t");
 
 	fputs(buf, fp);
-	fprintf(fp, "dir ");
+	if (xpinfo->dir >= XFRM_POLICY_MAX) {
+		xpinfo->dir -= XFRM_POLICY_MAX;
+		fprintf(fp, "socket "); 
+	}
+	else
+		fprintf(fp, "dir ");
+
 	switch (xpinfo->dir) {
 	case XFRM_POLICY_IN:
 		fprintf(fp, "in");
-- 
1.7.0.4


             reply	other threads:[~2010-09-13 13:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-13 13:29 Ulrich Weber [this message]
2010-09-13 15:24 ` [PATCH] iproute2: display xfrm socket policy direction 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=20100913132905.GA8366@babylon \
    --to=uweber@astaro.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.