Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/fstat Print BPF direction correctly.



details:   https://anonhg.NetBSD.org/src/rev/d0d0acd531a4
branches:  trunk
changeset: 323698:d0d0acd531a4
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Jun 26 10:00:25 2018 +0000

description:
Print BPF direction correctly.

diffstat:

 usr.bin/fstat/misc.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 3812ce317d16 -r d0d0acd531a4 usr.bin/fstat/misc.c
--- a/usr.bin/fstat/misc.c      Tue Jun 26 09:50:42 2018 +0000
+++ b/usr.bin/fstat/misc.c      Tue Jun 26 10:00:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: misc.c,v 1.19 2018/06/26 06:48:03 msaitoh Exp $        */
+/*     $NetBSD: misc.c,v 1.20 2018/06/26 10:00:25 msaitoh Exp $        */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: misc.c,v 1.19 2018/06/26 06:48:03 msaitoh Exp $");
+__RCSID("$NetBSD: misc.c,v 1.20 2018/06/26 10:00:25 msaitoh Exp $");
 
 #include <stdbool.h>
 #include <sys/param.h>
@@ -142,8 +142,12 @@
                (void)printf(", promisc");
        if (bpf.bd_immediate)
                (void)printf(", immed");
-       if (bpf.bd_direction)
-               (void)printf(", direction");
+       if (bpf.bd_direction == BPF_D_IN)
+               (void)printf(", in");
+       else if (bpf.bd_direction == BPF_D_INOUT)
+               (void)printf(", inout");
+       else if (bpf.bd_direction == BPF_D_OUT)
+               (void)printf(", out");
        if (bpf.bd_jitcode != NULL)
                (void)printf(", jit");
        if (bpf.bd_async)



Home | Main Index | Thread Index | Old Index