vpp.git
3 years agodpdk: fix compiling issue with clang 46/28446/1
Lijian.Zhang [Thu, 30 Apr 2020 06:52:15 +0000 (14:52 +0800)]
dpdk: fix compiling issue with clang

When building vpp image with below command, clang reports warnings/errors
on the unused option '-L', as it's not linking stage, and does not require
linking libraries.

In dpdk.mk, the linking library path should be attached to
DPDK_EXTRA_LDFLAGS, instead of DPDK_EXTRA_CFLAGS

$ make build-release CC=clang V=1

clang -Wp,-MD,./.ark_ddm.o.d.tmp  -fPIE -fPIC -pthread -I/root/origin/build-root/build-vpp-native/external/dpdk-20.02/lib/librte_eal/linux/eal/include  -march=armv8-a+crc -DRTE_MACHINE_CPUFLAG_NEON -DRTE_MACHINE_CPUFLAG_CRC32  -I/root/origin/build-root/build-vpp-native/external/dpdk-20.02/arm64-armv8a-linuxapp-clang/include -DRTE_USE_FUNCTION_VERSIONING -include /root/origin/build-root/build-vpp-native/external/dpdk-20.02/arm64-armv8a-linuxapp-clang/include/rte_config.h
-D_GNU_SOURCE -O3 -I./ -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wpointer-arith -Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -Wdeprecated -Wno-missing-field-initializers -Wno-address-of-packed-member -Werror   -g -mtune=generic -L/root/origin/build-root/install-vpp-native/external/lib -I/root/origin/build-root/install-vpp-native/external/include -o ark_ddm.o -c
/root/origin/build-root/build-vpp-native/external/dpdk-20.02/drivers/net/ark/ark_ddm.c
== Build drivers/vdpa/ifc
clang: warning: argument unused during compilation: '-L/root/origin/build-root/install-vpp-native/external/lib' [-Wunused-command-line-argument]
clang: error: argument unused during compilation: '-L/root/origin/build-root/install-vpp-native/external/lib' [-Werror,-Wunused-command-line-argument]

Type: fix

Change-Id: If8fd9b19d0aff9d3c27d77e78cd3064bb1ad6565
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
Reviewed-by: Jieqiang Wang <Jieqiang.Wang@arm.com>
Reviewed-by: Govindarajan Mohandoss <Govindarajan.Mohandoss@arm.com>
(cherry picked from commit 88d6ce2bee53b7c9f876aa78c5db8ab1ea75c08a)

3 years agovppinfra: loop counter off by 1 in search_free_list() 45/28445/1
Steven Luong [Thu, 7 May 2020 17:47:33 +0000 (10:47 -0700)]
vppinfra: loop counter off by 1 in search_free_list()

In search_free_list(), we have this do while loop.
do
  {
    l--;
    f_index = h->free_lists[b][l];
    f = elt_at (h, f_index);
    f_size = heap_elt_size (v, f);
    if ((s = f_size - size) >= 0)
      break;
  }
while (l >= 0);

When (l == 0), we still go back up to execute l--. Then l become -1. The
next statement is we index h->free_lists[b][-1]. After that, elt_at() would
probably cause a crash in the ASSERT.

Type: fix
Ticket: VPPSUPP-63

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I617d122aa221cfdfe38f8be50f4e0f0e76e11bb5
(cherry picked from commit ec7012e51edef4aec2239cb5b3a249f46d9b2cb0)

3 years agomisc: fix coverity warnings 44/28444/1
Dave Barach [Mon, 4 May 2020 18:47:45 +0000 (14:47 -0400)]
misc: fix coverity warnings

Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I51660e4b02f449bd2db12a8cfd395c6c343d2dee
(cherry picked from commit c72950e811880c22e5b350c4b1cb5e31b0735b4d)

3 years agordma: fix clang build 43/28443/1
Benoît Ganne [Tue, 5 May 2020 10:25:13 +0000 (12:25 +0200)]
rdma: fix clang build

Type: fix

Change-Id: I9b613f0af484f601dd20a851e2f59ee5e06b5c37
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 971c5be27996985e40f178c8d540a5807a428283)

3 years agovcl: allow vcl worker index to be set by applications 41/28441/1
IJsbrand Wijnands [Mon, 4 May 2020 15:57:33 +0000 (17:57 +0200)]
vcl: allow vcl worker index to be set by applications

When using vppcom_session* apis to setup TCP sessions in applications build outside of the VPP repository, it is necessary to set the worker_index explicitly when these apis are called from the none-VCL worker threads. An example is when data is to be sent to the TCP session that is originated from a different thread, like the main program thread or from the bin api thread. This change allows the application to set it.

Type: fix

Signed-off-by: IJsbrand Wijnands <ice@cisco.com>
Change-Id: I37f3654a49ea9a8cf3a0d3d0e672583018c12299
(cherry picked from commit 6017ff0dd7a27c062d0ad4687bfc70a69747ac55)

3 years agoapi: fix include_guard when path contains a plus 38/28438/1
Ruslan Babayev [Thu, 31 Oct 2019 08:37:50 +0000 (01:37 -0700)]
api: fix include_guard when path contains a plus

The path to VPP source might contain a '+' when building it
with Yocto/OpenEmbedded.

Type: fix

Signed-off-by: Ruslan Babayev <ruslan@babayev.com>
Change-Id: I205ac0de7d8726724af0e30f5b199391e05dc615
(cherry picked from commit 7f286f720d6fe2115423212dda6af66dd810691d)

3 years agomisc: add Matt Smith to the committer list 37/28437/1
Dave Barach [Thu, 30 Apr 2020 19:33:52 +0000 (15:33 -0400)]
misc: add Matt Smith to the committer list

In hopes of restoring his +2 button...

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I2600daab5afa4334713695d1074706fbb287832f
(cherry picked from commit e891ac2f198e7c00dceb2f2c6510f9bdf1cb91d1)

3 years agovcl: disconnect both flavors of bapi transport on destroy 36/28436/1
Florin Coras [Thu, 30 Apr 2020 02:59:55 +0000 (02:59 +0000)]
vcl: disconnect both flavors of bapi transport on destroy

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6697296b45c5816a31535b0cf44b8e726292b8bb
(cherry picked from commit dc0ded7dd7a6b8ee68df25cd56666de804e55e64)

3 years agovcl: add separate fcntl64 ldp handler 35/28435/1
Florin Coras [Wed, 29 Apr 2020 02:19:51 +0000 (02:19 +0000)]
vcl: add separate fcntl64 ldp handler

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Idb81e2901398dd6ae94931c705a704c7b52bbb36
(cherry picked from commit d7586d50f68655631482f33a83a1fe6f4f21ff64)

3 years agovlib: use flexible array in vlib_buffer for GCC-10 34/28434/1
Benoît Ganne [Fri, 24 Apr 2020 09:48:04 +0000 (11:48 +0200)]
vlib: use flexible array in vlib_buffer for GCC-10

GCC-10 increase overflows-related warnings but gets confused by 0-length
arrays. Use C99 flexible length array instead.

Type: fix

Change-Id: Ie62cfa8faaa408479a598785fd3f06ffd0233c7a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 049d0b438ef2971181549f195c7e0338cd1c60f4)

3 years agostats: add apis to delete simple/combined counters 33/28433/1
Ole Troan [Tue, 21 Apr 2020 15:54:41 +0000 (17:54 +0200)]
stats: add apis to delete simple/combined counters

vlib_free_simple_counter()
vlib_free_combined_counter()

Frees the name and two dimensional vector from the stats segment.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: If1becf7d09520ba41a3d59e2df94958ecfcf6948
(cherry picked from commit a568a19b2956ed8b94b11c2ef041412473dc8442)

3 years agoioam: do not reuse existing vnet symbol 32/28432/1
Benoît Ganne [Fri, 24 Apr 2020 07:20:13 +0000 (09:20 +0200)]
ioam: do not reuse existing vnet symbol

vxlan_gpe_init() is already defined in libvnet. When loading ioam plugin
we end up having 2 different objects using the same symbol.
ASan in GCC-10 started to enforce the One-Definition-Rule and it seems
like good hygiene anyway.

Type: fix

Change-Id: I2ea9af1821bca6482a290742e9a109fc25692f37
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 83ceffcd980494c6146ca67a0fa709b2c37ef13e)

3 years agovppinfra: harmonize function names 29/28129/2
Dave Barach [Thu, 6 Aug 2020 15:38:40 +0000 (11:38 -0400)]
vppinfra: harmonize function names

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Icce7eab4510785e15bdcf97e4d1881b0f46f6899
(cherry picked from commit d4a639bbd2257a88fa3f06939a23c13af1d56dd3)

3 years agovppinfra: selectively disable false-positive GCC-10 warnings 15/28415/1
Benoît Ganne [Fri, 24 Apr 2020 08:44:40 +0000 (10:44 +0200)]
vppinfra: selectively disable false-positive GCC-10 warnings

GCC-10 increase overflows-related warnings but is confused by SIMD
operations.

Type: fix

Change-Id: Iafde754c2fbec60e2d0a328f295b1f5c156d8234
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit a66971f980187efd03a84d340b80a7d3cf39deac)

3 years agoip: reassembly: fix one possible use-after-free 14/28414/1
Gao Feng [Sun, 26 Apr 2020 01:57:18 +0000 (09:57 +0800)]
ip: reassembly: fix one possible use-after-free

When use the kv->v.memory_owner_thread_index as the index to get the
reass in pool, maybe this element is freed by the owner thread because
of timeout, too many fragments, and so on.

So we should check if do_handoff with kv->v.memory_owner_thread_index
before get the reass from pool.

Type: fix

Signed-off-by: Gao Feng <davidfgao@tencent.com>
Change-Id: Ie0f1dc368f86d0fd65292ca0c5e1908348015e09
(cherry picked from commit 9165e0365cc21575fd3e4a98be59317a839553f4)

3 years agovppinfra: selectively disable false-positive GCC-10 warnings 13/28413/1
Benoît Ganne [Fri, 24 Apr 2020 09:32:13 +0000 (11:32 +0200)]
vppinfra: selectively disable false-positive GCC-10 warnings

GCC-10 increase overflows-related warnings but failed to infer that
b->n_cached_bytes is always < sizeof(uword).

Type: fix

Change-Id: I956ae609abc9e39d4a932e5801510999d7d27b79
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit ffbcf6178891bd68a97543ac91d28f37256d5e13)

3 years agobuild: add vppinfra/warnings.h to exported headers list 12/28412/1
Benoît Ganne [Fri, 24 Apr 2020 12:37:10 +0000 (14:37 +0200)]
build: add vppinfra/warnings.h to exported headers list

To allow the use of WARN_ON/OFF macros to selectively disable build
warnings.

Type: fix

Change-Id: Iceb9d28b2b80c373afb51900880c23041be836db
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit be7dbbbfdd49fcfff851f38d1d36d08fc9710604)

3 years agodevices: allow link state down with netlink 11/28411/1
Matthew Smith [Fri, 24 Apr 2020 18:43:12 +0000 (13:43 -0500)]
devices: allow link state down with netlink

Type: fix

Use the up parameter in vnet_netlink_set_link_state(). It was
ignoring the parameter and always setting IFF_UP on an interface.

Change-Id: I0d44406d982afbdc43bc6b26d0f22c0bdd47abdc
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 81284163a293759bc5c2d6a124639c6796589d15)

3 years agovcl: generate select events on read/write errors 10/28410/1
Florin Coras [Fri, 24 Apr 2020 17:09:25 +0000 (17:09 +0000)]
vcl: generate select events on read/write errors

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3429f9d0406b6d710846fc82d77400f26f77fdf4
(cherry picked from commit 5e6222a0332e38316b5a58b23c35cca69bb72025)

3 years agovppinfra: finish deprecating qsort.c 09/28409/1
Dave Barach [Fri, 24 Apr 2020 20:07:37 +0000 (16:07 -0400)]
vppinfra: finish deprecating qsort.c

Minor change to vec_sort_with_function(...): don't depend on the qsort
implementation to deal with null, zero-long, or 1-long vectors

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I7bd7b0421673d2a025363089562aa7c6266fba66
(cherry picked from commit f593b5792031b3797cdcdfd3fbb33ac4de8c9a5d)

3 years agonat: fix extended unit tests 08/28408/1
Klement Sekera [Thu, 23 Apr 2020 13:42:19 +0000 (13:42 +0000)]
nat: fix extended unit tests

Type: fix
Fixes: b86437b79b82493c2e9728929df417f55b153824

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I2c833928dcdceb4d23dfc161bcc3358272076980
(cherry picked from commit e7f420177620868275add23ba5fcea7c7d18c91a)

3 years agovapi: packed enum type generation 07/28407/1
Neale Ranns [Wed, 22 Apr 2020 16:06:45 +0000 (16:06 +0000)]
vapi: packed enum type generation

Type: fix

if the ,api/.json specifies that a enum should be u8/u16 that the
generated c enum needs to be packed.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ia0497b45e4c510a5c63cd02e966769bf20686838
(cherry picked from commit b5c0d35f9445d4d99f2c5c7bd3175e68721a8ee5)

3 years agomisc: update INFO.yaml 06/28406/1
Dave Barach [Thu, 23 Apr 2020 17:05:49 +0000 (13:05 -0400)]
misc: update INFO.yaml

Add Benoit Ganne to the committer list, remove committers who have
resigned, list committers in alphabetical order.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ic51092df774464e228cd875acf118827e9cd1923
(cherry picked from commit 0e2751cc1d246145cee6b1e4a588c30270c7ce21)

3 years agosession: fix session_table_get_or_alloc 05/28405/1
Andreas Schultz [Thu, 23 Apr 2020 08:41:50 +0000 (10:41 +0200)]
session: fix session_table_get_or_alloc

Extending the fib_index_to_table_index could leave entries uninitialized,
pointing to the session tables at index 0. That session index exists by
default, but it is a IPv4 session table. That would break all IPv6 on
the unitilized fib indexes.

Type: fix

Change-Id: Ie3f0a87a7f829ceb39f75ec06658b0ad1d3813ae
Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
(cherry picked from commit 30a28c187b0eb9216d5d7918712d98a4b7a5ba6a)

3 years agotcp: avoid bt sample access after possible pool realloc 04/28404/1
Florin Coras [Wed, 22 Apr 2020 22:07:43 +0000 (22:07 +0000)]
tcp: avoid bt sample access after possible pool realloc

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I98f943c8862fa74fb576f9ec1fb9186289b1216b
(cherry picked from commit c17ff6ec3b69ef228047bf346e0b524c48d2c96e)

3 years agovcl: fix use-after-free 03/28403/1
Benoît Ganne [Wed, 22 Apr 2020 17:14:03 +0000 (19:14 +0200)]
vcl: fix use-after-free

Make sure we disconnect from vlib prior to free-ing the last worker, as
we'll need to access it.

Type: fix

Change-Id: Id5bdd17f0f5efa1ce52021b4270eb4f1e95cc61d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 38ab5672b599df8ef201ca6733c9b008c37fdfa3)

3 years agotcp: fix use-after-free 02/28402/1
Benoît Ganne [Wed, 22 Apr 2020 17:15:49 +0000 (19:15 +0200)]
tcp: fix use-after-free

bts can be freed by the call to bt_fix_overlapped(). Save flags for
later use.

Type: fix

Change-Id: If8b48c96ce39e38f2ed7f4db2815122523eb2e05
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit a04adbf5368f9ec907508ff36d42fbd72d287120)

3 years agovat: fix increment_address(...) 01/28401/1
Dave Barach [Tue, 21 Apr 2020 12:01:16 +0000 (08:01 -0400)]
vat: fix increment_address(...)

vl_api_address_t uses a packed enum for the address family, compare
a->af directly with ADDRESS_IP4 / ADDRESS_IP6 instead of running a->af
through clib_host_to_net_u32(...) before compare.

Indirectly fixes api_ip_route_add_del(...) w/ count > 1.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ib7f562ec9e92ee63e52a338d318fcf1ce6221755
(cherry picked from commit 54582663ab7d7105bc2407036a311d68707e5ab9)

3 years agovlib: queue_hi_thresh fix to avoid deadlock 00/28400/1
Elias Rudberg [Thu, 16 Apr 2020 14:01:52 +0000 (16:01 +0200)]
vlib: queue_hi_thresh fix to avoid deadlock

Adapt queue_hi_thresh value using num_threads to avoid risk of deadlock
between threads which could happen for example when different NAT
threads try to handoff work to each other at the same time when their
frame queues are congested. This change ensures that each thread can
reserve a queue entry without causing problems even in the most extreme
case when all threads attempt to add to the same queue simultaneously
when the queue is nearly full.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: I9e02f753bd00833d8dd500d181b0d4f9a454d703
(cherry picked from commit 368104d06ad6d667a8cce152426916fc654b6627)

3 years agosr: fix non-NULL terminated string overflow 99/28399/1
Benoît Ganne [Fri, 17 Apr 2020 10:11:26 +0000 (12:11 +0200)]
sr: fix non-NULL terminated string overflow

Type: fix

Change-Id: Ia5ae0e893a5358f61353d20f444d88d79953e482
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit b9753540d2a69bbab807653fc3d0c1b43ec4d6d5)

3 years agosession: fix use-after-free in input node 98/28398/1
Benoît Ganne [Fri, 17 Apr 2020 10:09:37 +0000 (12:09 +0200)]
session: fix use-after-free in input node

Type: fix

Change-Id: Ie60b07abe76ad166f048f5885accd7038d8153b2
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 7ce23f25bbc01d534ca294ce88ab0d709e3e03a7)

3 years agosession: avoid rx notifications on accepting sessions 97/28397/1
Florin Coras [Sun, 19 Apr 2020 22:41:55 +0000 (22:41 +0000)]
session: avoid rx notifications on accepting sessions

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iba37e528e968104c3ba9c8324438ba695ddddfd1
(cherry picked from commit da302e4fce1003a2fdd2ace7e1ae09987399092c)

3 years agovcl: ensure sessions are open on select events 96/28396/1
Florin Coras [Sun, 19 Apr 2020 23:12:08 +0000 (23:12 +0000)]
vcl: ensure sessions are open on select events

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4d56b61af574dfdaf6028160ce331606bdf65609
(cherry picked from commit f49cf470c583507fa1b5b841887107071701ef5e)

3 years agovcl: expand vcl select maps in ldp if needed 95/28395/1
Florin Coras [Mon, 20 Apr 2020 01:32:38 +0000 (01:32 +0000)]
vcl: expand vcl select maps in ldp if needed

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I56c487821233cebf2146745a4706cb573cc088a5
(cherry picked from commit cbce80aaa3f1853856d4d64c95f10d65caa4d786)

3 years agogbp: fix l3-out anonymous test cleanup 94/28394/1
Benoît Ganne [Thu, 16 Apr 2020 14:57:00 +0000 (16:57 +0200)]
gbp: fix l3-out anonymous test cleanup

Type: fix

Change-Id: Ib455b0a57f9b4f9cb82bb295c220270d0c6e5fe5
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 040d47c2cce87255a101f301239192c5599b0db5)

3 years agolisp: fix use-after-free 93/28393/1
Benoît Ganne [Thu, 16 Apr 2020 10:39:39 +0000 (12:39 +0200)]
lisp: fix use-after-free

Type: fix

Change-Id: I42c3e3514ba50d40e09ee688d083f3e78fa0713a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 101fc278c3b7009c42574a25b96c4fb7fcd15e39)

3 years agovat: fix static analysis warning 92/28392/1
Andreas Schultz [Tue, 7 Apr 2020 11:40:36 +0000 (13:40 +0200)]
vat: fix static analysis warning

replace hand crafted version with existing vector function

Type: fix

Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
Change-Id: I94834852469ed316c7bdbd48bb7f479648b2c8e5
(cherry picked from commit 63551351b75d1363b57ed1810b0d7065ca5cd600)

3 years agodpdk: fix udp-encap for esp in transport mode 91/28391/1
Alexander Chernavin [Fri, 3 Apr 2020 14:18:44 +0000 (10:18 -0400)]
dpdk: fix udp-encap for esp in transport mode

Now UDP encapsulation doesn't work in transport mode because:
 - the encrypt node misses filling of UDP header and it gets sent with
   all zeros;
 - the decrypt node misses filling of new IP header and it contains
   garbage data.

With this commit, fill UDP header during encryption and fill IP header
during decryption.

Change-Id: I87a7bd594f0e312b16d3e5eb19e568b4e3164d36
Type: fix
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
(cherry picked from commit 82fc98fa4578dbbfb156effb11dea6a4e2d0b898)

3 years agovcl: fix app destroy 90/28390/1
Florin Coras [Thu, 16 Apr 2020 18:47:27 +0000 (18:47 +0000)]
vcl: fix app destroy

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I21daa87b1a301142270a1bf20680dd9e9395aac9
(cherry picked from commit ce815deb72fd3941b000aecec931131afc9d6c34)

3 years agofib: fix use-after-free 89/28389/1
Benoît Ganne [Thu, 16 Apr 2020 10:38:48 +0000 (12:38 +0200)]
fib: fix use-after-free

Type: fix

Change-Id: Ie7081d977dd0d3e7d09bc0d1b4d53863288e443b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 95eb01fdc65b692065ace6d76870d8cc9f3e2c84)

3 years agobier: fix vector size confusing ASan 88/28388/1
Benoît Ganne [Thu, 16 Apr 2020 10:40:54 +0000 (12:40 +0200)]
bier: fix vector size confusing ASan

The vector is initialized to 1024 entries which is guaranteed to be
enough, but as its size can shrink between calls, make sure ASan is
aware of the expected size before using it.

Type: fix

Change-Id: I4bcc39867a886b3cb463854d2cda0b32155650e9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 77100efb37f7cb333f9ab55dc206bf1431e3ae50)

3 years agoigmp: fix igmp proxy group merge 87/28387/1
Benoît Ganne [Thu, 16 Apr 2020 10:47:47 +0000 (12:47 +0200)]
igmp: fix igmp proxy group merge

When merging proxy groups in igmp_proxy_device_merge_group(), the call
to igmp_proxy_device_merge_src() can end up removing the current proxy
group via igmp_group_clear(). When that happens, it must returns NULL so
that igmp_proxy_device_merge_config() does not send a IGMPv3 report for
a dead proxy group.
Make igmp_group_clear() reset the group pointer to NULL to fix this bug
and to detect similar bugs more easily.

Type: fix

Change-Id: I229e55b5bfa71734d7844893f5209a66fa3cc8ae
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit bd7f3422bbe38ba87888b765e94b56bfcbb9602c)

3 years agosession: detach session from app on cleanup 86/28386/1
Florin Coras [Tue, 14 Apr 2020 23:52:12 +0000 (23:52 +0000)]
session: detach session from app on cleanup

Type: fix

Avoids unwanted notifications.

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ifff27fb0d3644194e3bb3f91d7ed1fd02c6730cd
(cherry picked from commit 77ea42b31ae12f0aef829097225e353199360f30)

3 years agofib: fix accessing empty dpo pool elements 85/28385/1
ShivaShankarK [Fri, 10 Apr 2020 12:50:02 +0000 (18:20 +0530)]
fib: fix accessing empty dpo pool elements

Type: fix

Signed-off-by: ShivaShankarK <shivaashankar1204@gmail.com>
Change-Id: Iee88a2101ce42d7f1cdb65df532c349d14829e4c
(cherry picked from commit 35acaac1843839f94e9bd40ad45a8d170a155f22)

3 years agoudp: fix local node no port error counter 84/28384/1
Florin Coras [Fri, 10 Apr 2020 02:01:51 +0000 (02:01 +0000)]
udp: fix local node no port error counter

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie0c5a86aedfa38fdcbb835aee7c9e91d59b222d6
(cherry picked from commit bc1a1a7347d689aa7043d4d7f15a7db657230216)

3 years agofib: fix adjacency cli command issue 83/28383/1
ShivaShankarK [Thu, 9 Apr 2020 15:45:58 +0000 (21:15 +0530)]
fib: fix adjacency cli command issue

Type: fix

Signed-off-by: ShivaShankarK <shivaashankar1204@gmail.com>
Change-Id: I193023705003e664c50487fdfaa42b813604a078
(cherry picked from commit ae9c45938bdf6e180f83f02aed31113e60db20a9)

3 years agomisc: fix error handling in punt_replicate 82/28382/1
Dave Barach [Wed, 8 Apr 2020 18:31:45 +0000 (14:31 -0400)]
misc: fix error handling in punt_replicate

If vlib_buffer_clone (...) fails due to a buffer allocation error, update
*n_dispatched with the actual number of clones, not the requested
number of clones.

Punt_replicate(...) should not set *to_next[0] = bi0. The original
buffer is enqueued separately in punt_dispatch_node(...)

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I774ad8f8c1a0633de4cf8ae5530629201c229347
(cherry picked from commit 1adc7e78ad3eb7e800d0ce3ace56f53ab7aebffe)

3 years agovat: fix vat strncpy stringop-overflow 81/28381/1
Ray Kinsella [Tue, 7 Apr 2020 15:35:22 +0000 (16:35 +0100)]
vat: fix vat strncpy stringop-overflow

Fix GCC 9.0 barf on vat strncpy.

Type: fix

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I5e41225d6ac9673a9d953046720df55e7b69c479
Signed-off-by: Dave Barach <dave@barachs.net>
(cherry picked from commit b1bb513792fecd735effebbd07d867ea93adc9f6)

3 years agovat: fix static analysis warning 80/28380/1
Dave Barach [Mon, 6 Apr 2020 14:19:18 +0000 (10:19 -0400)]
vat: fix static analysis warning

Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ia46f865082dcf0cf06af99a7c958c4a5b02193ce
(cherry picked from commit 032a5e3da0f4350390d97d6011160fe0d34a8d6e)

3 years agomisc: strcpy be gone 79/28379/1
Dave Barach [Sat, 4 Apr 2020 22:34:41 +0000 (18:34 -0400)]
misc: strcpy be gone

Causes static analysis "vulnerability" warnings

Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I272fa69251d70f62178e6dff0423c16f99937af1
(cherry picked from commit 0250090fc0c24214cb1fa969f6e2f585099ee36b)

3 years agomisc: sprintf be gone 78/28378/1
Dave Barach [Sat, 4 Apr 2020 14:05:48 +0000 (10:05 -0400)]
misc: sprintf be gone

Along with related static analysis warnings...

Type: fix
Ticket: VPP-1837
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I2c6949c7a2250b8f76a63508c7c210daecfe0f91
(cherry picked from commit 3e07a4a1e843267892dc291a833d93bd70597011)

3 years agomisc: fix sonarcloud html issue 75/28375/1
Dave Wallace [Fri, 3 Apr 2020 17:50:57 +0000 (17:50 +0000)]
misc: fix sonarcloud html issue

Type: fix

Change-Id: I3691c310fa6336bf2c103c42bccd94c27aab4878
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit 39aa7a5202a6a875bd6f5d341cb07f19ab0bf51e)

3 years agodpdk: VM VHOST tests with rxq>1 failing 74/28374/1
Steven Luong [Thu, 2 Apr 2020 04:50:10 +0000 (21:50 -0700)]
dpdk: VM VHOST tests with rxq>1 failing

DPDK recently added a check in the virtio driver to make sure that
rxmode->mq_mode == ETH_MQ_RX_NONE. We were passing ETH_MQ_RX_RSS
and the device initialization was not accepted.

The reason for the change in DPDK was that there is no controls
(algorithm, redirection table, hash function). So they thought ETH_MQ_RX_NONE
was the best choice for the value of mq_mode.

Type: fix
Ticket: VPP-1853

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ifa0fc4206cedc56a851f94f6434a2a7500bbd419
(cherry picked from commit b32436aab9626cb8b7bc4099142135c5c9e19beb)

3 years agomisc: fix static analysis warnings 73/28373/1
Dave Barach [Thu, 2 Apr 2020 14:44:09 +0000 (10:44 -0400)]
misc: fix static analysis warnings

One actual bugfix.

Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Icef25167f97a70cc795c0a481174de319ed79ad5
(cherry picked from commit c35f3e835b4078fedabc1ff5013bc4727f533e16)

3 years agosession: fix fifos display 72/28372/1
Aloys Augustin [Wed, 1 Apr 2020 17:50:17 +0000 (19:50 +0200)]
session: fix fifos display

This prevents a crash with quic listeners, and enables the display
of udp fifo status.

Change-Id: Ib9f48818ee3e51a3fa43ad8ab175e8aa7750df8f
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
(cherry picked from commit 6eef40bce3f5ae2b06ba75d5b4cf32f168a801e4)

3 years agoudp: validate input data length 71/28371/1
Florin Coras [Tue, 31 Mar 2020 01:49:40 +0000 (01:49 +0000)]
udp: validate input data length

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3f34011ca61ded310d0411e7b50548982bd164ac
(cherry picked from commit 936197467aac08b7620c9cb0614817b90466968e)

3 years agoipsec: use id in ipsec_tunnel_protect_details 70/28370/1
Matthew Smith [Tue, 31 Mar 2020 14:52:17 +0000 (09:52 -0500)]
ipsec: use id in ipsec_tunnel_protect_details

Type: fix

The data populated into an ipsec_tunnel_protect_details message includes
an outbound SA and a list of inbound SAs for a tunnel interface. These
are populated with SA indices. The values used by an API client
to refer to an SA in other messages is the SA id rather than the index.
Use the SA id instead of the index.

Change-Id: Ifaad32801092a7f87bd0dcf19de418d36613f8dd
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 5cee0bca5d0f01d3f26e90dee79780382e843d04)

3 years agosession: fix coverity warning 69/28369/1
Dave Barach [Thu, 26 Mar 2020 14:56:13 +0000 (10:56 -0400)]
session: fix coverity warning

Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ib5da600b7a40f775de7dc5b9aaa8d967e49e8632
(cherry picked from commit 4897d77c6d4d5d04eb7e02bda57dc6c7005a609f)

3 years agoip: Adding IP tables is no MP safe 68/28368/1
Neale Ranns [Wed, 25 Mar 2020 07:21:09 +0000 (03:21 -0400)]
ip: Adding IP tables is no MP safe

Type: fix

it was marked MP safe in the CLI (which it shouldn't be) but
it it not marked MP safe on the API.

Change-Id: I4bdea498a510a8b406d13d62a899b6d03656f7e8
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 31d6c738c20d3baa619dbbb08af6125fab32bc08)

3 years agoavf: fix rx queue refill on buffer alloc failure 67/28367/1
Damjan Marion [Wed, 25 Mar 2020 10:44:41 +0000 (11:44 +0100)]
avf: fix rx queue refill on buffer alloc failure

If buffer alloc fails, it may happend that rx queue will be stuck
as old code only refills if at least one packet is received.

Type: fix
Change-Id: I388c4f8a9fb2c208bdc222e31b443cbe6b94af82
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit e7f7190381c66cca6c1c3c77b3d43148818a5a4e)

3 years agovcl: fix ldp recv return on error 66/28366/1
Florin Coras [Tue, 24 Mar 2020 15:24:29 +0000 (15:24 +0000)]
vcl: fix ldp recv return on error

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I0875705d3a0c95f2781b0595ef27a30486438aae
(cherry picked from commit 2a6642e95dc18d7c56f87b74a70658b8312b8c08)

3 years agovcl: fix ldp writev 0 vecs 65/28365/1
Florin Coras [Mon, 23 Mar 2020 16:00:35 +0000 (16:00 +0000)]
vcl: fix ldp writev 0 vecs

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iec5db8dcf3a019b731e15fd79d0208d6eb10943b
(cherry picked from commit eda1b8c32f9857bb749835b0189af002b224927d)

3 years agoavf: proper promisc handling 64/28364/2
Damjan Marion [Tue, 24 Mar 2020 12:51:13 +0000 (13:51 +0100)]
avf: proper promisc handling

Type: fix
Change-Id: Id20a0fe77372602fd211156ccee01c18d829d8df
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 1839fe165c7ffb834775b8582fe0ee2321ff2ab6)

3 years agovirtio: vhost gso checksum error when both indirect and mrg_rxbuf are off 63/28363/2
Steven Luong [Tue, 17 Mar 2020 16:01:30 +0000 (09:01 -0700)]
virtio: vhost gso checksum error when both indirect and mrg_rxbuf are off

Turn on gso, turn off both indirect and mrg_rxbuf caused traffic received
and sent with checksum error. The problem is we are not mapping the hdr
correctly in the shared memory address.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I7ef3bc2755544167b0e624365988111b17399e89
(cherry picked from commit b232d192f2f77114e26cf7f99b57bcd6140872d0)

3 years agodpdk: false link down issue with ixgbe NIC 62/28362/2
Lijian.Zhang [Thu, 19 Mar 2020 02:22:52 +0000 (10:22 +0800)]
dpdk: false link down issue with ixgbe NIC

This issue is observed with X520-2 NICs on FD.io lab Taishan server.
After VPP booting up and bringing up  the interfaces with command "set
interface state <interface> up", it still shows link down status from
the command "show hardware-interfaces". However, the hardware link
status is actually up. dpdk_process() cannot get the hardware link
status correctly via rte_eth_link_get_nowait().

In ixgbe_dev_link_update_share(), if the media type is fiber and the
link is down, a flag (IXGBE_FLAG_NEED_LINK_CONFIG) is set. A callback to
ixgbe_dev_setup_link_alarm_handler() is scheduled trying to set up the
link and clear the flag afterwards.

If the device is started or stopped before the flag is cleared, the
scheduled callback is canceled. This causes the flag to remain set and
subsequent calls to ixgbe_dev_link_update_share() return without trying
to retrieve the link state because the flag is set.

When the callback is canceled by either interface start or stop
operation, in ixgbe_dev_cancel_link_thread(), after cancelling the
callback/thread, unset the flag on the device to avoid this condition.

Type: fix

Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Reviewed-by: Jieqiang Wang <Jieqiang.Wang@arm.com>
Change-Id: I04de377dc048307a78a5b7109ebdfaf376d5e029
(cherry picked from commit 1690dcb49527934e83748e7b6db8501b33c3758a)

3 years agovlib: complain if workers are configured twice 61/28361/2
Vladimir Isaev [Tue, 17 Mar 2020 09:30:11 +0000 (12:30 +0300)]
vlib: complain if workers are configured twice

Right now following configuration leads to crash:
cpu {
    corelist-workers 2
    workers 2
}

because threads count will be set to 2, but we have only
one core in coremask.

Type: fix
Signed-off-by: Vladimir Isaev <visaev@netgate.com>
Change-Id: Ia93b892733971e7c8ddfceaaec5f4eb8bf9063ac
(cherry picked from commit 18a4a371646bccfd299e6a509e801a524aeb4c92)

3 years agovlib: fix error when creating avf interface on SMP system 60/28360/2
Jieqiang Wang [Mon, 13 Jan 2020 09:15:13 +0000 (17:15 +0800)]
vlib: fix error when creating avf interface on SMP system

On SMP architecture, '/sys/bus/pci/devices/<devices id>/numa_node' file
will return -1 as a valid value if it does not have any NUMA node information.
Using -1 as a valid node id to access data structures will cause memory issue.
Fix the error by setting the value of numa_node to 0 if '/sys/bus/pci/devices/
<devices id>/numa_node' returns -1 and it is a SMP system.

Type: fix

Change-Id: Ib60e79c3656fe5b17e08fd9011122683e8b08b6f
Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
(cherry picked from commit 76c6159d83c2dfe29f84dc4b05d399cdbbdf2878)

3 years agoip: provide extern declaration for ip punt nodes 59/28359/2
Jawahar Santosh Gundapaneni [Thu, 19 Mar 2020 20:42:28 +0000 (16:42 -0400)]
ip: provide extern declaration for ip punt nodes

Type: fix

Signed-off-by: Jawahar Santosh Gundapaneni <jgundapa@cisco.com>
Change-Id: Ife0f7749a72cc834a3d811f8cf6b5a0840157014
(cherry picked from commit 62ad2aaff3810f4ec0f010700091c2f59fbfe466)

3 years agotcp: count dupacks with no sacks 58/28358/2
Florin Coras [Thu, 12 Mar 2020 15:50:57 +0000 (15:50 +0000)]
tcp: count dupacks with no sacks

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia2e29b4776c0f8df666da39a14c5ef2fa1693c21
(cherry picked from commit 7fd59cc79c9fb0cccd0cb5c0b4579d0f0a004f6b)

3 years agoethernet: Copy only 6 bytes of mac address into a u64 57/28357/2
Jon Loeliger [Mon, 9 Mar 2020 18:13:35 +0000 (13:13 -0500)]
ethernet: Copy only 6 bytes of mac address into a u64

Rather than leaving 2 bytes of junk in the upper word
of a mac address represented as a u64, zero them out.
That way later compairsons stand a chance of matching
when deleting a bridge's arp termination entries.

The volatile qualifier shouldn't be needed here, but
without it the compiler removes the clib_memcpy() at -O2.
Bad compiler.  No biscuit.

Type: fix
commit: faf22cb303b65e2a6bf8dad959d7f5ee6d031c4f

Change-Id: Iebcf35fdd421293dccbcaefadef767f7e139438e
Signed-off-by: Jon Loeliger <jdl@netgate.com>
(cherry picked from commit 6a32ce326495bfe48ebef74dfbb8a9c1cf37a530)

3 years agopg: update packet generator test scripts 56/28356/2
ShivaShankarK [Wed, 18 Mar 2020 10:04:11 +0000 (15:34 +0530)]
pg: update packet generator test scripts

update packet generator test scripts to reflect latest code changes

Type: fix

Signed-off-by: ShivaShankarK <shivaashankar1204@gmail.com>
Change-Id: I048a5e8b9b0506dcb0b664e5549d13f51b2e2ea6
(cherry picked from commit b0f956c255de7aa61fead96b7b94bcf937d92c05)

3 years agolb: fix coverity warning 54/28354/1
Dave Barach [Tue, 10 Mar 2020 11:13:20 +0000 (07:13 -0400)]
lb: fix coverity warning

Type: fix
Ticket: VPP-1837
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I357eb72d478d8175ab9c7cf502d312ab3112213e
(cherry picked from commit a53068905eb3f005a5a6d324c37f51056fb49b3e)

3 years agoudp: fix UDP socket byte order in lookup 52/28352/1
Andreas Schultz [Mon, 9 Mar 2020 10:36:15 +0000 (11:36 +0100)]
udp: fix UDP socket byte order in lookup

The port registry uses host byte order for while the session API
uses network order. In a single place the conversion was missing.

Type: fix
Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
Change-Id: Ic8cfe2cb4e0711b3e0614060ff6b4f2fe4ed4391
(cherry picked from commit 49a11cff8e7892858d946d3f93ae19502236c358)

3 years agomisc: Fix vpp-selinux-policy dependency on CentOS 8 51/28351/1
Renato Botelho do Couto [Fri, 6 Mar 2020 19:42:22 +0000 (13:42 -0600)]
misc: Fix vpp-selinux-policy dependency on CentOS 8

policycoreutils-python is now called python3-policycoreutils on
CentOS 8.

Type: fix

Signed-off-by: Renato Botelho do Couto <renato@netgate.com>
Change-Id: I46264c66a2a719d546e0926f3bd716e986461963
(cherry picked from commit 1d94ab5f1b4557c9e017af7e9da0f821cae1fa72)

3 years agofib: path flag FIB_API_PATH_TYPE_INTERFACE_RX not copied to client 50/28350/1
IJsbrand Wijnands [Thu, 5 Mar 2020 14:25:32 +0000 (06:25 -0800)]
fib: path flag FIB_API_PATH_TYPE_INTERFACE_RX not copied to client

This path flag FIB_API_PATH_TYPE_INTERFACE_RX is not copied to the client bin_api.

Type: fix

Change-Id:

Signed-off-by: IJsbrand Wijnands <ice@cisco.com>
Change-Id: I612044d2f564c852f83fceb63ce750a6330e1365
(cherry picked from commit 79437c8dbc707e6f60e7a2425fac15c4153f71b3)

3 years agovppapigen: crc is a negative value for some messages when using python 2.7 49/28349/1
Mark Nelson [Wed, 4 Mar 2020 20:32:09 +0000 (15:32 -0500)]
vppapigen: crc is a negative value for some messages when using python 2.7

Type: fix

Signed-off-by: Mark Nelson <manelso2@cisco.com>
Change-Id: I4f121e49d3c05c21eed3fed2469bd88fc84e2271
(cherry picked from commit ea2abbaeaf34a4652e970fd1e2f60c0d377ebde4)

3 years agoebuild: fix the distclean target 48/28348/1
Dave Barach [Fri, 28 Feb 2020 14:50:33 +0000 (09:50 -0500)]
ebuild: fix the distclean target

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I32142962cb70ea0d92cda1b0ffaac42b7de15974
(cherry picked from commit 952ec0e0a68ccf5a4c3c00894bb26a25d80910a3)

3 years agovppapigen: list imports in JSON 47/28347/1
Ondrej Fabry [Mon, 3 Feb 2020 22:25:23 +0000 (23:25 +0100)]
vppapigen: list imports in JSON

Type: fix

Change-Id: If50477f2487d8c13f91c119a1492370e6e937904
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
(cherry picked from commit eec5d48040695e45c4880adb59bb18ebacd667c1)

3 years agolb: Fix generating illegal key in per-port vip 46/28346/1
Yasuhiro Nakamura [Mon, 17 Feb 2020 04:03:38 +0000 (13:03 +0900)]
lb: Fix generating illegal key in per-port vip

VIP prefix index becomes always 0 when adding a VIP which is already registered different port, causing LB config crash.
This change assigns the same VIP prefix index to the same VIP.

Ticket: https://jira.fd.io/browse/VPP-1834
Type: fix

Signed-off-by: Yasuhiro Nakamura <yanakamu@yahoo-corp.jp>
Change-Id: Ib63b3e58db9bd85714d68cd1292aadd0c8580da8
(cherry picked from commit 551775eaaa9c162c73e15690e4d7580935e9a70a)

3 years agovat: add ip api types parser definitions 45/28345/1
Jakub Grajciar [Wed, 26 Feb 2020 10:01:43 +0000 (11:01 +0100)]
vat: add ip api types parser definitions

build vat with src/vnet/ip/ip_types_api.c

Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: Iab0f18bf7a89cf9512beab0629bc3a349edec383
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
(cherry picked from commit 23a386b71b287bc95000a8980856c5dbe7cdaf5a)

3 years agomap: handle IPv6 extension headers for TCP/UDP 44/28344/1
Vladimir Isaev [Wed, 26 Feb 2020 10:21:35 +0000 (13:21 +0300)]
map: handle IPv6 extension headers for TCP/UDP

Without this patch offset for TCP/UDP headers was not calculated
correctly if there is one or more IPv6 extension headers.

Type: fix
Signed-off-by: Vladimir Isaev <visaev@netgate.com>
Change-Id: I04d6f5e42f8f072987192d6236085afbd74a4420
(cherry picked from commit 7d4cd0cf6f1a94953ef97ab885752424dea6948c)

3 years agounittest: Skip string test case for sizeof (src) > sizeof (dst) 43/28343/1
Steven Luong [Tue, 25 Feb 2020 19:06:17 +0000 (11:06 -0800)]
unittest: Skip string test case for sizeof (src) > sizeof (dst)

coverity complains that the subject test may cause dst buffer overrun
problem and it is right. The problem is when __builtin_constant_p (n)
returns true, memcpy_s_inline skips all the errors checking and does the
copy blindly. Please see the code in memcpy_s_inline.

The fix is to skip the subject test when the aformentioned builtin function
returns true.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I50de91cc0c853a134b3bcf3b0cd8d45d7668b092
(cherry picked from commit 2da39718f560478678caacccd198ee4c0c9673c3)

3 years agocrypto-openssl: fix coverity warnings 38/28338/2
Filip Tehlar [Mon, 24 Feb 2020 21:06:38 +0000 (21:06 +0000)]
crypto-openssl: fix coverity warnings

Type: fix

Change-Id: Ia42ff39a0a33f89901b8333a9e6ca82ca9805cc6
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 41e831f5588fe5ebfd879f4e570e85e12770b360)

3 years agotcp: remove useless prediction 37/28337/2
Simon Zhang [Sat, 22 Feb 2020 19:51:42 +0000 (03:51 +0800)]
tcp: remove useless prediction

Type: fix

Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
Change-Id: Ie2dc2653baec92347eb2cbcd197a2e5ec6a80c79
(cherry picked from commit 487507f40f4e443ff1e683641206db80875f3477)

3 years agogbp: Coverity warnings for unitialized variables 36/28336/2
Neale Ranns [Thu, 20 Feb 2020 12:56:22 +0000 (12:56 +0000)]
gbp: Coverity warnings for unitialized variables

Type: fix

Change-Id: If74ad528e68f45b00719295388e0e1399452ef93
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit e9a630a5248ee6e234c1bf1fdb2c29fc6239f60d)

3 years agofib: Uninitialised pad in the prefix (coverity warning) 35/28335/2
Neale Ranns [Thu, 20 Feb 2020 13:10:47 +0000 (13:10 +0000)]
fib: Uninitialised pad in the prefix (coverity warning)

Type: fix

Change-Id: Ia61d6fbf6e80977f83f1f6672e5e83b52ddeb0e5
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit ea96e92361b483962fd2a6b027cedc02f3bb6f93)

3 years agoipip: Unintialized return variable (coverity warning) 34/28334/2
Neale Ranns [Thu, 20 Feb 2020 13:16:49 +0000 (13:16 +0000)]
ipip: Unintialized return variable (coverity warning)

Type: fix

Change-Id: I008f23b5f0c7269ddd35cc747a867240fbe9c49b
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit d057625d499525625d60d2207665eaeb755e380e)

3 years agoip: Unintialized variables in prefx setup (coverity warning) 33/28333/2
Neale Ranns [Thu, 20 Feb 2020 13:13:45 +0000 (13:13 +0000)]
ip: Unintialized variables in prefx setup (coverity warning)

Type: fix

Change-Id: I048c9ed423ca2993d2179cdce364ac98980311bb
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 39a233a0aa21c644c78ddd4ffa0ab3cdb1c10318)

3 years agotcp: fix coverity warning in bt 32/28332/2
Florin Coras [Thu, 20 Feb 2020 16:04:03 +0000 (16:04 +0000)]
tcp: fix coverity warning in bt

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4153a9a377b8b1da1366a94ff791ad99617b7a6d
(cherry picked from commit 62a7fe28933b6310b9a4e3a0fab99949587576ac)

3 years agolisp: fix coverity warnings 31/28331/2
Florin Coras [Thu, 20 Feb 2020 16:11:23 +0000 (16:11 +0000)]
lisp: fix coverity warnings

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie060b25b5e8c85d9b2037e300723a2b6023c65d1
(cherry picked from commit 6ce954f8e4446472689146024126ba42da182aa9)

3 years agofib: adjacency midchain teardown (VPP-1841) 30/28330/2
Neale Ranns [Tue, 18 Feb 2020 13:56:24 +0000 (13:56 +0000)]
fib: adjacency midchain teardown (VPP-1841)

Type: fix

Change-Id: I57f8bfbce4feed9d2775875cb8b1b729a47900a4
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 24064d02aa9810ebc64c16dc778a179bb0ef5483)
(cherry picked from commit 3ebebc3a2fe47f1222ba035e04ccd8caed0cf58f)

3 years agomap: honor pre-resolve param in map-t 29/28329/2
Alexander Chernavin [Tue, 11 Feb 2020 14:57:09 +0000 (09:57 -0500)]
map: honor pre-resolve param in map-t

With this commit, forward the translated packet directly to the
specified next-hop if pre-resolve param is enabled in MAP-T.

Type: fix

Change-Id: Ie26080c7820318c7982599577a4af6e4d01a0574
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
(cherry picked from commit f145c15631ba62e798395499f83a2f8a91ae83c7)
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
3 years agomisc: fix coverity warnings 28/28328/1
Dave Barach [Mon, 17 Feb 2020 14:13:26 +0000 (09:13 -0500)]
misc: fix coverity warnings

Add an ALWAYS_ASSERT (...) macro, to (a) shut up coverity, and (b)
check the indicated condition in production images.

As in:
 p = hash_get(...);
 ALWAYS_ASSERT(p) /* was ASSERT(p) */
 elt = pool_elt_at_index(pool, p[0]);

This may not be the best way to handle a specific case, but failure to
check return values at all followed by e.g. a pointer dereference
isn't ok.

Type: fix
Ticket: VPP-1837
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ia97c641cefcfb7ea7d77ea5a55ed4afea0345acb
(cherry picked from commit 47d41ad62c5d6008e72d2e9c137cf8f49ca86353)

3 years agotls: remove session lookup operation in TLS 27/28327/1
Yu Ping [Fri, 14 Feb 2020 11:14:36 +0000 (19:14 +0800)]
tls: remove session lookup operation in TLS

Type: fix

Change-Id: I50329bda365d98f9f9d56a58187fb4fb2a4eb461
Signed-off-by: Yu Ping <ping.yu@intel.com>
(cherry picked from commit 985d9293a08dc3da016fbeeaa3f8fff10e1b504e)

3 years agovcl: fix ldp read on closing session 26/28326/1
Florin Coras [Fri, 14 Feb 2020 05:33:46 +0000 (05:33 +0000)]
vcl: fix ldp read on closing session

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I60be191866d20721951ad22f571a2a3275511e12
(cherry picked from commit 067f9544d52c95c0b60b0e8425fce1e295120180)

3 years agodpdk: fix flow(with mark action) deletion crash issue 25/28325/1
Chenmin Sun [Mon, 20 Jan 2020 12:17:09 +0000 (20:17 +0800)]
dpdk: fix flow(with mark action) deletion crash issue

Type: fix

this patch fixes mark flow deletion crash issue, see below

test flow add src-ip any proto udp src-port 111 dst-port 222 mark 100
test flow enable index 0 1/1
test flow disable index 0 1/1
test flow enable index 0 1/1
test flow disable index 0 1/1 -> [crash]

This is because the code resets a wrong vector in flow lookup entry
recycle logic. See function dpdk_flow_ops_fn().

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I2b0a1e531931ab25541d672d88da18dc2289f1ce
(cherry picked from commit cd120f9bbb2101dfd7eca11d1a28e06ac5ace479)

3 years agonsim: fix quad-loop packet trace 24/28324/1
Dave Barach [Thu, 13 Feb 2020 15:08:01 +0000 (10:08 -0500)]
nsim: fix quad-loop packet trace

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I756170bd799d1f482186cbb4b5dff9373ae6e08f
(cherry picked from commit 3be33f17ecd14a12738a44f9c0e09cb3778b1345)

3 years agovcl: clear accept msg flags 23/28323/1
Florin Coras [Thu, 13 Feb 2020 20:04:28 +0000 (20:04 +0000)]
vcl: clear accept msg flags

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Idb513232e7b091c8f767726bfa1deb10a7e3b751
(cherry picked from commit e88845e4fea2c6b6743ff7790cc2247631d65189)

3 years agoapi: do not truncate api dump file size 22/28322/1
Benoît Ganne [Tue, 21 Jan 2020 17:35:49 +0000 (18:35 +0100)]
api: do not truncate api dump file size

Type: fix

Change-Id: I5c81d2f55057f5fba780cb12154a3fb1aef79f20
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit aba4983ad48374a50cd93ba91f66be241f210279)

3 years agosession: avoid scanning new io list under load 21/28321/1
Florin Coras [Sun, 9 Feb 2020 20:03:12 +0000 (20:03 +0000)]
session: avoid scanning new io list under load

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Idaa7cc26ad941be86daec4ed5920727237712f4a
(cherry picked from commit 16d974ec59776f0103ad62d0d04dc57989eef7ed)