diff options
author | Calvin <calvin.ference@gmail.com> | 2016-07-04 16:30:50 -0400 |
---|---|---|
committer | Chris Luke <chris_luke@comcast.com> | 2016-07-05 23:25:40 +0000 |
commit | ed9b757a106c2a7193a90734e43fce9feac21e30 (patch) | |
tree | ce0b1bfe5d289bd1c6dd17ace9216a6ab8990f46 /vnet | |
parent | 2195706fef482cf7f295cd2e8c416541161c1724 (diff) |
VPP-144: Fix that shows the empty segment field in sh sr tunnel
Change-Id: Idc71a48f2eab3b712f6953af8baf1a6ecd54dcaf
Signed-off-by: Calvin <calvin.ference@gmail.com>
Diffstat (limited to 'vnet')
-rw-r--r-- | vnet/vnet/sr/sr.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vnet/vnet/sr/sr.c b/vnet/vnet/sr/sr.c index 845bf95c423..05d8d8166da 100644 --- a/vnet/vnet/sr/sr.c +++ b/vnet/vnet/sr/sr.c @@ -137,6 +137,7 @@ u8 * format_ip6_sr_header_flags (u8 * s, va_list * args) u8 * format_ip6_sr_header (u8 * s, va_list * args) { ip6_sr_header_t * h = va_arg (*args, ip6_sr_header_t *); + ip6_address_t placeholder_addr = {{254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254}}; int print_hmac = va_arg (*args, int); int i, pl_index, max_segs; int flags_host_byte_order = clib_net_to_host_u16(h->flags); @@ -160,8 +161,12 @@ u8 * format_ip6_sr_header (u8 * s, va_list * args) s = format (s, "\n Segments (in processing order):"); - for (i = h->first_segment; i >= 0; i--) + for (i = h->first_segment; i >= 1; i--) s = format (s, "\n %U", format_ip6_address, h->segments + i); + if (ip6_address_is_equal(&placeholder_addr, h->segments)) + s = format (s, "\n (empty placeholder)"); + else + s = format (s, "\n %U", format_ip6_address, h->segments); s = format (s, "\n Policy List:"); |