make the gre flowid output always 2 chars so payloads stay lined up.
authordlg <dlg@openbsd.org>
Sat, 24 Feb 2018 08:53:36 +0000 (08:53 +0000)
committerdlg <dlg@openbsd.org>
Sat, 24 Feb 2018 08:53:36 +0000 (08:53 +0000)
usr.sbin/tcpdump/print-gre.c

index b1ecc2f..93ca80b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: print-gre.c,v 1.18 2018/02/09 04:08:26 dlg Exp $      */
+/*     $OpenBSD: print-gre.c,v 1.19 2018/02/24 08:53:36 dlg Exp $      */
 
 /*
  * Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -171,7 +171,7 @@ gre_print_0(const u_char *p, u_int length)
 
                /* maybe NVGRE, or key entropy? */
                vsid = (key & NVGRE_VSID_MASK) >> NVGRE_VSID_SHIFT;
-               printf(" key=%u|%u+%0x", key, vsid,
+               printf(" key=%u|%u+%02x", key, vsid,
                    (key & NVGRE_FLOWID_MASK) >> NVGRE_FLOWID_SHIFT);
        }