X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvat%2Fapi_format.c;h=14f66c31fa7c70679f5f637c5d278622301fc469;hb=3337bd22002e9b78459082c34f7b78370b177eb0;hp=f2d10b78de530822a22a842c78a92009fd48d495;hpb=2b9838ac60395c8c79cd1010025732aa9d7e9fac;p=vpp.git diff --git a/src/vat/api_format.c b/src/vat/api_format.c index f2d10b78de5..14f66c31fa7 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -10758,7 +10758,10 @@ api_sr_localsid_add_del (vat_main_t * vam) u8 behavior = ~0; u32 sw_if_index; u32 fib_table = ~(u32) 0; - ip6_address_t next_hop; + ip6_address_t nh_addr6; + ip4_address_t nh_addr4; + memset (&nh_addr6, 0, sizeof (ip6_address_t)); + memset (&nh_addr4, 0, sizeof (ip4_address_t)); bool nexthop_set = 0; @@ -10769,7 +10772,9 @@ api_sr_localsid_add_del (vat_main_t * vam) if (unformat (i, "del")) is_del = 1; else if (unformat (i, "address %U", unformat_ip6_address, &localsid)); - else if (unformat (i, "next-hop %U", unformat_ip6_address, &next_hop)) + else if (unformat (i, "next-hop %U", unformat_ip4_address, &nh_addr4)) + nexthop_set = 1; + else if (unformat (i, "next-hop %U", unformat_ip6_address, &nh_addr6)) nexthop_set = 1; else if (unformat (i, "behavior %u", &behavior)); else if (unformat (i, "sw_if_index %u", &sw_if_index)); @@ -10781,9 +10786,12 @@ api_sr_localsid_add_del (vat_main_t * vam) M (SR_LOCALSID_ADD_DEL, mp); - clib_memcpy (mp->localsid_addr, &localsid, sizeof (mp->localsid_addr)); + clib_memcpy (mp->localsid.addr, &localsid, sizeof (mp->localsid)); if (nexthop_set) - clib_memcpy (mp->nh_addr, &next_hop, sizeof (mp->nh_addr)); + { + clib_memcpy (mp->nh_addr6, &nh_addr4, sizeof (mp->nh_addr6)); + clib_memcpy (mp->nh_addr4, &nh_addr6, sizeof (mp->nh_addr4)); + } mp->behavior = behavior; mp->sw_if_index = ntohl (sw_if_index); mp->fib_table = ntohl (fib_table);