X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fudp%2Fudp_pg.c;h=621beb792770e0cf2f653723ca4814e3e50304c6;hb=c5df8c71c;hp=a81a9d2ed40e5dc6edaaf150a27534a6e82c418e;hpb=fc3b8b8ad08d2d4cc375149ecdc10c37d4a80940;p=vpp.git diff --git a/src/vnet/udp/udp_pg.c b/src/vnet/udp/udp_pg.c index a81a9d2ed40..621beb79277 100644 --- a/src/vnet/udp/udp_pg.c +++ b/src/vnet/udp/udp_pg.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Cisco and/or its affiliates. + * Copyright (c) 2015-2019 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -39,6 +39,7 @@ #include #include /* for unformat_udp_udp_port */ +#include #define UDP_PG_EDIT_LENGTH (1 << 0) #define UDP_PG_EDIT_CHECKSUM (1 << 1) @@ -191,17 +192,25 @@ unformat_pg_udp_header (unformat_input_t * input, va_list * args) u16 dst_port; tcp_udp_port_info_t *pi; + /* For the pg format of applications over UDP local */ + udp_dst_port_info_t *pi2 = NULL; + pi = 0; if (p->dst_port.type == PG_EDIT_FIXED) { dst_port = pg_edit_get_value (&p->dst_port, PG_EDIT_LO); pi = ip_get_tcp_udp_port_info (im, dst_port); + pi2 = udp_get_dst_port_info (&udp_main, dst_port, UDP_IP4); + if (!pi2) + pi2 = udp_get_dst_port_info (&udp_main, dst_port, UDP_IP6); } if (pi && pi->unformat_pg_edit && unformat_user (input, pi->unformat_pg_edit, s)) ; - + else if (pi2 && pi2->unformat_pg_edit + && unformat_user (input, pi2->unformat_pg_edit, s)) + ; else if (!unformat_user (input, unformat_pg_payload, s)) goto error;