* [PATCH] iproute2: display xfrm socket policy direction
@ 2010-09-13 13:29 Ulrich Weber
2010-09-13 15:24 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: Ulrich Weber @ 2010-09-13 13:29 UTC (permalink / raw)
To: shemminger; +Cc: netdev
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
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] iproute2: display xfrm socket policy direction
2010-09-13 13:29 [PATCH] iproute2: display xfrm socket policy direction Ulrich Weber
@ 2010-09-13 15:24 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2010-09-13 15:24 UTC (permalink / raw)
To: Ulrich Weber; +Cc: netdev
On Mon, 13 Sep 2010 15:29:05 +0200
Ulrich Weber <uweber@astaro.com> wrote:
>
> 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");
Applied (with cleanup) thanks.
--
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-13 15:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-13 13:29 [PATCH] iproute2: display xfrm socket policy direction Ulrich Weber
2010-09-13 15:24 ` Stephen Hemminger
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).