7895 Commits

Author SHA1 Message Date
Filip Tehlar
9c4d10c7ae ikev2: use remote proposals when installing tunnel
Type: fix

Change-Id: Ia1556aa854fa83fb5340308c4eec868b7b4f8351
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-08-20 13:40:16 +00:00
Filip Tehlar
fcb03a0ea5 ikev2: announce both 'ESN' and 'No ESN'
Type: fix

Change-Id: If73b88b9478b9314df6d9163c3a13724d4253c80
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit fbd47cf83546613ce16f8fc10105609cf51cbfc2)
2020-08-20 09:54:39 +00:00
Filip Tehlar
c8b09a2d40 ikev2: fix wrong index computation
Type: fix

Change-Id: Ia7b07b4ec9e5681946f3f5c01c230c1f814e2cf6
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit c17d6cfaf4fc66927f28af9d8d7cb8ce2a1d839c)
2020-08-20 09:54:39 +00:00
Filip Tehlar
f77f8e2909 ikev2: fix incorrect reply messages
Type: fix

Change-Id: Idd679885f42de45429a1dcbf3b0af1037dc54d2b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit fe7b8c2b4aeadaa5cf3f55b0fcc04600c91df427)
2020-08-20 09:54:39 +00:00
Florin Coras
bf03bfa801 http_static: fix session cleanup
While cherry-picking: Fix extras/scripts/check_commit_msg so it accepts '_' characters in
feature names.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ibb380eecca76ed9c00ed14c167dfcf576f943db0
(cherry picked from commit 0f4e3c22ed5951e0a68e6b40fda1ac63ab5e3c3e)
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-08-20 09:54:39 +00:00
Dave Barach
a4a6ce66f5 dns: fix coverity warnings
Type: fix
Ticket: VPP-1837

Partial cherry-pick from a357a938019c8df2b061cc5bd14cd8a64fac694f

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I0d164147173b452fee7e720e01e6a9991f43b64a
2020-08-20 09:53:29 +00:00
Steven Luong
cfd710d2fc memif: wrong interface counter is incremented
vlib_increment_combined_counter takes sw_if_index, not hw_if_index.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Iecde2697ed490940f0eff796d28d15381405b895
(cherry picked from commit 35050289e6b5f6e2939b1d08ed058ab952468943)
2020-08-19 15:05:14 +00:00
Benoît Ganne
1fa4b3a4bc vppinfra: fix clib_count_equal_u8/16/32/64 overflow
Type: fix

Change-Id: Id5ca868cd7a2abc9320206f0336aa3348f5906e3
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 2a0bd4a7d1745bee38ac80bcc4c8bc6e5af2a7cc)
2020-08-18 19:47:21 +00:00
Benoît Ganne
f3e7275743 ip: fix punt cli to only consumes a line of input
Type: fix

Change-Id: Idb6f82e08b29e3805ed2133acb5fd7226148f672
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 9ae3c6a40f268741b87f94a5b75f1b5d1d2128e3)
2020-08-18 19:47:21 +00:00
Florin Coras
b2d6edce86 hsa: fix http server session cleanup
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6832e3f24a56e043415a32eb4072d0bfb7697251
(cherry picked from commit 7d941d45bc649f760c650dab3e715585a61d9cf9)
2020-08-18 19:47:21 +00:00
Florin Coras
1cadeaab98 lisp: fix cli locator-set name null termination
Type: fix

Change-Id: I5f550bd6a03f47b829ef99803cb6b9ac86329450
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 39771adc1da61943978c18b58b35dedc9dddc4b0)
2020-08-18 19:47:21 +00:00
Florin Coras
554159af58 lisp: fix lisp/one enable/disable
Type: fix

Change-Id: Iefe6b3a1a0a999d89ef9812fc14d31159043e60c
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 508dc51bd075f6bb16862265c0c43e8efb76349c)
2020-08-18 19:47:21 +00:00
Benoît Ganne
0e67a25052 lacp: fix vector overflow
Type: fix

Change-Id: I8f776ce10ee8c29689db5ceef70df42dfb6b747c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit c72995dd79500dd5791e71fd3edeae527c257351)
2020-08-18 19:47:21 +00:00
Benoît Ganne
7e9f66ec40 interface: fix show/clear hardware-interfaces string overflow
Type: fix

Change-Id: Iab99bc1f6c309fae6eaa714b484274fe7072a4cb
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 17814d74dbbc85573adbf970644caa4b1ac9bbb4)
2020-08-18 19:47:21 +00:00
Benoît Ganne
09da69951b pci: fix non NULL-terminated vector used as C string overflow
Type: fix

Change-Id: Iab512ba8c72c9e20aeba2d4265276bcabf095d46
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit e3a24300d08f04146935ec0d3b02e03276d6cc68)
2020-08-18 19:47:21 +00:00
Florin Coras
27901c9952 session: cleanup lookup table for rejected session
Type: fix

Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id20f693a5acdee74ab534e9964418973537b977f
(cherry picked from commit c7fd24e30bb5ac68f3c82eafee9dc192289add7f)
2020-08-18 19:47:21 +00:00
Benoît Ganne
cafaac98e7 feature: fix feature config data initialization overflow
Copy only exactly the data provided by the user even when it is not a
4-bytes multiple.

Type: fix

Change-Id: I2ef987c37e58523a38b46b09227529db2c26aa55
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit c79a14f13a0db6f59123e0e6b0b71d4f24433b01)
2020-08-18 19:47:21 +00:00
TimotheeChauvin
76797dc615 pppoe: fix uninitialized memory bug
In pppoe_cp_node.c, node->errors[error0] was accessed without
node->errors being initialized.

Found with AFL + ASAN.

Type: fix
Signed-off-by: TimotheeChauvin <timchauv@cisco.com>
Change-Id: Ide8a60021b2d47b5e2fce7062d8f12c7f4d225f7
(cherry picked from commit 2887159a1a5f5c501c2df59bf88e6faa38e9699f)
2020-08-18 19:47:21 +00:00
Benoît Ganne
5269067510 vppinfra: fix format_c_identifier vector overflow
In case of vector, we must check length before trying to access element.
Also fix wrong DPDK plugin workaround.

Type: fix

Change-Id: I2ecef1c88ebef2362f48cab0d462699aa43cd4b9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 1bd6f61820c6c15534ebb04a4b070ba84bf08a9d)
2020-08-18 19:47:21 +00:00
Benoît Ganne
d48d51df23 vppinfra: enable STATIC_ASSERT with clang
For some reason clang does not support &((struct foo*)0)->field in
static assertion contrary to gcc.
Use offsetof() macro implementation provided by both compilers instead.

Type: fix

Change-Id: I3311cdd29c5861e45dc0ef92f2bbd66242ca73b8
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 5e60c17f49082b7731778e81b58177177a31b58f)
2020-08-18 19:47:21 +00:00
Chenmin Sun
edec3f6041 ip: fix format_ip6_address_and_mask() bug
Previously there's a format_ip4_address in format_ip6...
This patch fixes this typo

Type: fix

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Ice124db6594720ed35a992d069341f399c331e1d
(cherry picked from commit e30f9c5c6342a0f2430848ec4166b75596642964)
2020-08-18 19:47:21 +00:00
jiangxiaoming
806f3f6177 ip: set ip4 mask for ip_copy and ip_set when dealing with ip4 type
Type: fix

Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
Change-Id: I3ace7dfe3ddacb4f7fa7a974a2ffe2b3cf902ff9
(cherry picked from commit 9268b5823fa7a16195f638e5b1f9c54b430f2f3c)
2020-08-18 19:47:21 +00:00
Mohsin Kazmi
15c9670d9d ip: fix the order in ip4 punt redirect
Type: fix
Fixes: a84cb715f5a4366dd2f32de18ad92bec566924da

Change-Id: Id448d6ae9cfdd3122e8187121c509412835117c5
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit c6eae9c079defa4812270945d614c4598db262d8)
2020-08-18 19:47:21 +00:00
Dave Barach
64c2689c3e classify: fix debug CLI
unformat_ip6_mask wasn't accounting for customized field names
when deciding if it managed to parse at least one field.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I26cab4c6828b510e277079628af5115ac43af3ff
(cherry picked from commit 126c88544103d3775252f741398111875f6a62d7)
2020-08-18 19:47:21 +00:00
Ryujiro Shibuya
1ff8a6c32a tcp: avoid rcv wnd more than RX fifo can enqueue
Type: fix

Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie358b731f8ecb1fcaebd6e79f5ce5c10802c2814
(cherry picked from commit cc1085647b2ae36e6c086d65b4e81b9f1cf9fc9a)
2020-08-18 19:47:21 +00:00
Vadym Martsynovskyy
347a225866 udp: align udp_encap_t_ to 2 cachelines
Based on the comments in the struct, udp_encap_t_ is meant to span 2
cachelines. Due to the 64 bit alignment of dpo_id_t, the struct spanned
3 cachelines. This caused fetching ue_ip_proto to trigger an additional
cache miss. This patch rearranges the ordering of the struct fields
so that udp_encap_t_ only spans 2 cachelines as intended.

before:
(gdb) print (int)&((struct udp_encap_t_*)0)->cacheline1
$8 = 128

after:
(gdb) print (int)&((struct udp_encap_t_*)0)->cacheline1
$1 = 64

Type: fix
Signed-off-by: Vadym Martsynovskyy <vmartsyn@fb.com>
Change-Id: I066c08654d4a8ef3e2d3954e957d4c5d382b209f
(cherry picked from commit 42386fc974148f812ef3eb73ff09a603caa23565)
2020-08-18 19:47:21 +00:00
Mohsin Kazmi
86a5a5d5c2 ip: fix the punt redirect for ip4
Type: fix

Change-Id: I39341f201209931392f315ead5adfddd8b567caf
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit a84cb715f5a4366dd2f32de18ad92bec566924da)
2020-08-18 19:47:21 +00:00
Klement Sekera
4784b2a696 nat: avoid division by zero
Return error instead of dividing by zero.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I9f6a942e87ab87e8f1921e744ec1add45884e74a
(cherry picked from commit fe77bdc1906cca6a76bd44b1aceffc971f64cec4)
2020-08-18 19:47:21 +00:00
Klement Sekera
bef1019aa3 nat: deterministic: disallow invalid config
Prevent overflow if input network prefix is too small and crash on
packet #1 due to vector not being allocated/initialized.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I3494cc62ce889df48cc59cc9340b5dd70338c3a8
(cherry picked from commit f3d7bd9d4d652b1c4b687267acdb9fdb908a74bd)
2020-08-18 19:47:21 +00:00
Damjan Marion
ccaef621a8 vppinfra: fix u32x4_gather definition
Type: fix
Change-Id: I3df8d3f277bfadee95bfc329e8ce8b929a986af6
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 97b9e008b9e072120ea8b0d98e81e898c3adbd4d)
2020-08-18 19:47:21 +00:00
Dave Barach
3180fe5651 misc: fix sonarclound warnings
Type: fix
Ticket: VPP-1888
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I9c2fb926a5e010658088a74051c8c3462ff61734
(cherry picked from commit 1af730d0dfbb91475c6808ed579494d3d223b724)
2020-08-18 19:47:21 +00:00
Benoît Ganne
6ed8162090 api: check id is valid for bounce checking
If the id is invalid we cannot check whether we must free the message or
not, free it anyway.

Type: fix

Change-Id: Ie4426f601390d1e5e14c739f670e8c1e6e3aaf1e
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit ff13e46215ab96df988310b4a20eddefad92de99)
2020-08-18 19:47:21 +00:00
Benoît Ganne
7f0abd5bd5 buffers: fix non-default sized buffers initialization
Type: fix

Change-Id: I4a93e1d9936414c514cb237a22624986b3ef5b3d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit c16fe4689055242c64c71d83e41908a8fb6c2726)
2020-08-18 19:47:21 +00:00
Steven Luong
aa62162cbc vlib: node recyling and node deletion missing triggering graph node sync
When recycling a graph node vnet_register_interface, it is missing an
explicit call to vlib_worker_thread_node_runtime_update(). However,
there is an implicit call to vlib_worker_thread_node_runtime_update()
via vnet_sw_interface_set_flags_helper() if it enables a new feature on
the interface for the first time. But that implicit call is not
guaranteed. For example, if an interface is created, deleted, and
created, then it may skip the implicit call to
vlib_worker_thread_node_runtime_update(). When that happens, the graph
nodes on thread 0 are not sync'ed to the worker threads. So the worker
thread's graph nodes are out of sync momentarily with the main thread's
graph nodes until some other event happens which calls for a sync is
needed. During this window, the worker thread's graph node is
vulnerable and may experience a crash.

When deleting a graph node, we never trigger a sync to the worker
thread. A patch was committed 3 years ago via
https://gerrit.fd.io/r/c/vpp/+/7523 to fix a show run crash. In
hindsight, the approach taken by 7523 is not orthogonal. While at it,
let's fix it right for both issues with a call to
vlib_worker_thread_node_runtime_update() in the appropriate place and
remove 7523.

Type: fix
Ticket: VPPSUPP-86
Fixes: gerrit 7523 / 19e9d954bd9eb4f04d48640d6540198e84ef65d7

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ic9472bd2d3a212dbfeceb526506ed0400983a142
(cherry picked from commit 1eae8ecb7acc7d80d5c08e300295bec94bf78f0b)
2020-08-18 19:47:21 +00:00
Dave Barach
3c450d3a3e mactime: print error if feature not enabled
Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I8fbc4baefecf512573126c5085ed7a6e2e360fbe
(cherry picked from commit c1f0d9c105c25c67d9ef86a53c10d43d40b61fe0)
2020-08-18 19:47:21 +00:00
Dave Barach
29e70a6eb1 fib: fix multiple dpo pool expand cases
Add dpo_pool_barrier_sync/release, use them to clean up
thread-unsafe pool expansion cases.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I09299124a25f8d541e3bb4b75375568990e9b911
(cherry picked from commit 26d890eb4b1ab19fea4d2d02bfc6dc89d2c1b771)
2020-08-18 19:47:21 +00:00
Dave Barach
1c39c6556d fib: fix adj pool expand cases
adj_alloc (...) is not thread safe when the adj pool or combined
counter vectors expand.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I55710de6ecc083b7434e11798659cca9250c9131
(cherry picked from commit c2d2228e928b7c69dc88e9c3b7502966d0e32d8d)
2020-08-18 19:47:21 +00:00
Dave Barach
1c73742cb3 fib: add barrier sync, pool/vector expand cases
load_balance_alloc_i(...) is not thread safe when the
load_balance_pool or combined counter vectors expand.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I7f295ed77350d1df0434d5ff461eedafe79131de
(cherry picked from commit 8341f76fd1cd4351961cd8161cfed2814fc55103)
2020-08-18 19:47:21 +00:00
Klement Sekera
77335de45a nat: fix coverity warning
Type: fix

Change-Id: I0e87021b11009a955f5839bdb68af897145816c1
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit c39c79c5aa7b5410f3aad4a770a741ab04f7dcc5)
2020-08-18 19:47:21 +00:00
Elias Rudberg
a4a794d152 misc: ipfix-export unformat u16 collector_port fix
Use %U and unformat_udp_port instead of %u for unformat() call for
u16 collector_port number in set_ipfix_exporter_command_fn() to
avoid corruption of other variables which can happen if unformat()
with %u is used with a 16-bit variable. This avoids crash due to
corrupted fib_index value.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: Id54273fcc458a7f9c5aa4025aa91711f160c1c1a
(cherry picked from commit 2dca180db989ea7afacdf4e70cc85e4408557382)
2020-08-18 19:47:21 +00:00
Mohsin Kazmi
895c37fb8a tap: fix rx queue index
Type: fix

Change-Id: I5601bdeb47d08118476ff7bd29435d2c1dba34b9
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 04f4d91c9fe6c8d639e28edb5dd3df2c82f92428)
2020-08-18 19:47:21 +00:00
Benoît Ganne
1e02f19305 dhcp: use per-thread vlib main instead of global one
Type: fix

Change-Id: I8890aa5cc3c576fc9fb68735549dfab721714310
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit dcd4aa2110e274f9185e1e5b47ec22d66cc23136)
2020-08-18 19:47:21 +00:00
Elias Rudberg
2da3548777 nat: fix regarding vm arg for vlib_time_now call
Change in snat_ipfix_header_create() to use thread-specific
vlib_main_t *vm pointer to avoid problems with different threads
accessing the same vlib_main_t data structure. This avoids
assertion failure when vlib_time_now() is called with a vm
corresponding to a different thread.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: I2096c1debb5688d3b97e5ed9a0ea78d94053d8b7
(cherry picked from commit 5556813fb63d28240a17ccf18f947e60c4cbb263)
2020-08-18 19:47:21 +00:00
Neale Ranns
915c3d9058 fib: Fix interpose source reactivate
Type: fix

when the interpose is on an adj-fib and the cover is removed the adj
source will not install. this lead to no path list being found for the
interpose source and a crash. pick a drop path list in this case.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ied217da043926c913657080f5ffb151201225d23
(cherry picked from commit 1bf6df4ff9c83bac1fc329a4b5c4d7061f13720a)
2020-08-18 19:47:21 +00:00
Benoît Ganne
8149d3427d dpdk: fix pktmbuf pool private data init
Type: fix

Change-Id: I7349840af48eec209532dab43a8ad0bd68993268
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit c32a84c70efb45081568fc8aa5fa1884d74865fe)
2020-08-18 19:47:21 +00:00
John Lo
3736bbbbf4 l2: L2/L3 mode swicth cleanup and l2-patch fix
Cleanup L2/L3 mode switch to not redirect to/from ethernet-input node
as it is no longer necessary.
L2 patch should use sw_if_index for device feature enable/disable.

Type: fix

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I0f24161d027b07c188fd1e05276146f94c075710
(cherry picked from commit f415a3b53a51b261d08cc3312c25f250d6bc1bd6)
2020-08-18 19:47:21 +00:00
Ignas Bacius
3c0ea3ddea misc: fix typo in set-ipfix-exporter CLI short_help
Type: fix
Change-Id: Id6687780b9a740323bd2eef58447864e70dc0235
Signed-off-by: Ignas Bacius <ignas@noia.network>
(cherry picked from commit f3a522fb3f3a82e579fbdd3f4bb94e399ad95bb1)
2020-08-18 19:47:21 +00:00
Benoît Ganne
449f50555d vlib: restore commands for non-interactive sessions
'quit' and 'show terminal' are valid for non-interactive sessions too.

Type: fix
Fixes: a58be82dda89d6496f92e451b42eee31f0cf47b4

Change-Id: Ib63244c7b64ad2e30c257ed19e982295f59bfffa
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 10a22a629468b18f5b07316980e2761285283939)
2020-08-18 19:47:21 +00:00
Dave Barach
b1a7f68b22 g2: fix the g2 build for Ubuntu 20.04
Shut off deprecated declaration warnings

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I65ea4bbc4d5ee5a11d4e8f554f414f57944c7e1c
(cherry picked from commit 18a86c6e6069cbc9a0d2294ebb7f7cca5f616f84)
2020-08-18 19:47:21 +00:00
hanlin
acf0bd5567 vcl svm: fix rx event loss
When vcl_epoll_wait_handle_mq handles rx events exceeding maxevents, VPP will not signal because cursize > 0, and the remaining rx events cannot be triggered because the eventfd event has been read. Therefore, we should dequeue all events until cursize = 0. And then handle msg up to maxevents with vcl_epoll_wait_handle_mq_event and those beyond with vcl_handle_mq_event.

Type: fix
Signed-off-by: hanlin <hanlin_wang@163.com>
Change-Id: I8a0c87cb41c837deb8284b40f668cc3c7d9d6e56
Signed-off-by: hanlin <hanlin_wang@163.com>
(cherry picked from commit d0e646f6892e9c85278c9538760a8940c86dcdbb)
2020-08-18 19:47:21 +00:00