diff options
| author | Xin LI <delphij@FreeBSD.org> | 2012-10-04 22:40:22 +0000 |
|---|---|---|
| committer | Xin LI <delphij@FreeBSD.org> | 2012-10-04 22:40:22 +0000 |
| commit | 0de8253a2f7ef0628846edb4fdcceb9ccab12d7a (patch) | |
| tree | c9eca0fdb327e86bea07fe747313f828731215ca /print-ip6opts.c | |
| parent | 60894fde29002aac35c5aff244b0f45c4d590413 (diff) | |
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: |
