X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvat%2Fip_types.c;h=8edcb133f33883fc2ede9f2bbac752f7761c831b;hb=84b543d8b1522d70aada38f3db49aade5230fc64;hp=5041c12924554b4f8d40b8ae2f0d58a94a9c472d;hpb=3b519b38b0df186f424d2ff2f5e8015408d67c53;p=vpp.git diff --git a/src/vat/ip_types.c b/src/vat/ip_types.c index 5041c129245..8edcb133f33 100644 --- a/src/vat/ip_types.c +++ b/src/vat/ip_types.c @@ -64,9 +64,12 @@ uword unformat_ip_prefix (unformat_input_t * input, va_list * args) { ip_prefix_t *a = va_arg (*args, ip_prefix_t *); + /* %d writes more than a u8 */ + int plen; if (unformat (input, "%U/%d", unformat_ip_address, &ip_prefix_addr (a), - &ip_prefix_len (a))) + &plen)) { + ip_prefix_len (a) = plen; if ((ip_prefix_version (a) == AF_IP4 && 32 < ip_prefix_len (a)) || (ip_prefix_version (a) == AF_IP6 && 128 < ip_prefix_len (a))) {