Subject: [PATCH] iproute2: display xfrm socket policy direction

From: Ulrich Weber <[email-masked]>
Date: Mon, 13 Sep 2010 15:29:05 +0200

display socket policy direction

Signed-off-by: Ulrich Weber <[email-masked]>
---
 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