diff options
Diffstat (limited to 'print-ip6opts.c')
-rw-r--r-- | print-ip6opts.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/print-ip6opts.c b/print-ip6opts.c index 7a4bf5593a869..2121b46039ad0 100644 --- a/print-ip6opts.c +++ b/print-ip6opts.c @@ -141,6 +141,8 @@ ip6_opt_print(const u_char *bp, int len) int i; int optlen = 0; + if (len == 0) + return; for (i = 0; i < len; i += optlen) { if (bp[i] == IP6OPT_PAD1) optlen = 1; @@ -271,10 +273,11 @@ ip6_opt_print(const u_char *bp, int len) printf("(type %d: trunc)", bp[i]); goto trunc; } - printf("(opt_type 0x%02x: len=%d) ", bp[i], bp[i + 1]); + printf("(opt_type 0x%02x: len=%d)", bp[i], bp[i + 1]); break; } } + printf(" "); #if 0 end: |