8925 Commits

Author SHA1 Message Date
ea9bc28592 ipsec: fix use-after-free
Type: fix

Change-Id: I1068ff1d03883addb5fe1005a8b608eab17e4168
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-16 17:16:36 +00:00
77100efb37 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>
2020-04-16 17:16:11 +00:00
bd7f3422bb 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>
2020-04-16 17:15:03 +00:00
063f2b86ed udp: fix buffer trace
Type: fix

Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
Change-Id: I774ca50582281cb3cc5e43417e74d178bf4909bd
2020-04-16 16:20:43 +00:00
1a0a897706 nat: scavenging functionality removed
Type: refactor

Change-Id: I9f743ba2818e1b1c5004c3575925cc7b479948d8
Signed-off-by: Filip Varga <fivarga@cisco.com>
2020-04-16 14:05:46 +02:00
8daeea9a5d vppinfra: don't use memcmp to compare keys in cuckoo
Type: improvement
Change-Id: I7e11bf72be5fad5967724c038eb649a261294ca0
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-04-15 19:34:11 +00:00
88bcba80d5 vppinfra: delay bucket2 calc in cuckoo search
There is no need to calculate bucket2 if there is hit on bucket1

Type: improvement
Change-Id: Id01c37963497668c0160068501294568a181d011
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-04-15 19:34:03 +00:00
7edc86d005 vppinfra: add clib_cuckoo_search_inline_with_hash function
Type: improvement
Change-Id: I547263ae954506f11101666ff768524fbfdb579e
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-04-15 19:33:45 +00:00
08eb2bb205 pg: set vnet buffer flags in pg streams
See .../extras/pg/checksum_offload.pg for a nontrivial example, which
deliberately sets bogus ip and udp checksums in the generated packets,
then fixes the mess with (software emulated) hardware checksum
offload.

Validated via "pcap dispatch trace on max 1000 buffer-trace pg-input 100".
Packets stuffed into loop1-output have the configured bogus ip and udp
checksums. vnet_calc_checksums_inline(...) fixes the checksums, which
are correct when packets visit loop1-tx.

The packet generator is a dumb robot in this regard. If you ask for a
ridiculous flag combination - example: ip4 and ip6 - your mileage may
vary.

Type: feature

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I6d9e790f373bcd9e445a89113ca8e4c8f9aa9419
2020-04-15 19:19:29 +00:00
4422753b9f vppinfra: install missing cuckoo hash header files
Type: improvement
Change-Id: Ifb4eec00fd4f1d19e4b0af802d015a35e402e0af
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-04-15 17:23:50 +00:00
77ea42b31a session: detach session from app on cleanup
Type: fix

Avoids unwanted notifications.

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ifff27fb0d3644194e3bb3f91d7ed1fd02c6730cd
2020-04-15 15:00:05 +00:00
92d0eacefb urpf: Allow locally generated packets on TX
Type: fix

Change-Id: I87d301aec20b9f5b34997b394493c796188fce14
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-04-15 14:55:42 +00:00
1e8d949781 tcp: allow local port sharing if 5-tuple available
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id0c4b46247e7419a328387678a4753cfb1e42d75
2020-04-15 14:04:04 +00:00
1bd2c019eb misc: refactor calc_checksums
Merge two mildly incompatible static inlines, and rename the results
vnet_calc_checksums_inline (...).

The resulting inline has three additional parameters: int is_ip4, int
is_ip6, and int with_gso. All calls manage to pass one or more as
compile-time constants, which causes a certain amount of code to
disappear in each instantiation.

Type: refactor
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I1a2a0e353b9a7bca20bc81318e8c915617261e1a
2020-04-15 11:00:26 +00:00
69eeadc03f vat: fix socket connection
vat_socket_connect(...) needs to set the api main client index. The M2
helper macro needed to allocate a buffer of size sizeof(*mp) + n, not
sizeof(*mp).

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I7abf35d2ba045d82765bd27f88899287fd351602
2020-04-14 21:40:46 +00:00
1bd461615f session: avoid all session cleanup on unlisten
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ifff49366ad538bf2dd64487cae17e7457dff064f
2020-04-14 14:44:50 +00:00
d724e4f43b urpf: Unicast reverse Path Forwarding (plugin)
Type: feature

 - move the IP4 code to plugin
 - add ip6 support
 - add suport for uRPF on TX
 - add tests

Change-Id: I074c2debc486d3e79c12fad4b8dbd72c41e841a0
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-04-14 09:40:48 +00:00
dc3e966485 ipsec: validate number of input sas
Type: fix

There is a statically allocated array for inbound SAs which can hold
4 IDs. The input parameter containing the IDs of th inbound SAs is a
vector and Its possible to pass a vector with more than 4 elements
and write the memory past the end of the array. Fail if more than 4
SAs are passed in the vector.

Change-Id: I0c9d321c902d6366b8aff816d04e343dcbd110eb
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-04-14 07:37:28 +00:00
4fde4ae036 session: remove ho with fifos support
Type: refactor

UDPC (removed) was the only consumer.

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2812bf58d3c68fe021ec73acaa1bd00ef3172846
2020-04-13 16:58:11 +00:00
c74b43c807 buffers: configurable buffer fault injector
When configured at compile time via the cmake
VPP_BUFFER_FAULT_INJECTOR option, the buffer allocator will appear to
fail a certain fraction of the time.

By default, the allocator succeeds 80% of the time. Detailed command
line configuration options are available, but only when the image has
been compiled with cmake option described above:

    vlib { buffer-alloc-success-rate [0.0 ... 1.0]
           buffer-alloc-success-seed <nnnn> }

Modify vlib_buffer_pool_create(...) so 0 is always an invalid buffer
index.

Debug images: add checks for bad buffer index enqueues, and also
verify that f->n_vectors doesn't accidentally map one or more
instances of the frame poison pattern 0xfefefefe.

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Iab939858014463d1e664682805013d334d6fcbe5
2020-04-13 15:54:31 +00:00
c54162981c dhcp: fix unicast pkts, clean up state machine
Send dhcp unicast packets to ip4-lookup. Otherwise, these packets
won't reach a dhcp server on a different subnet.

Do an immediate client scan after processing wakeup events.

Calculate the next process wakeup time by scanning all
clients.

Increase maximum (idle, no-clients-configured) timeout to 1000
seconds.

Reduce log spew.

Type: fix
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I3d10cd4c353298ed0b19e7e30887dc1d8d07b19e
2020-04-13 14:51:18 +00:00
111666766d session: cleanup debug code
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie6c03195019fe18c547b22f4387d7f2b14b71461
2020-04-13 03:04:45 +00:00
7357043d2a session: adding debug events
Type: feature

Enhancing the debugging capability of tcp session layer by measing time spent for various events.
This is meant only for debugging purpose

Signed-off-by: Srikanth Akula <srakula@cisco.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I9f401881b345bcae5f7d8050338637fd47b3723b
Signed-off-by: Srikanth Akula <srakula@cisco.com>
2020-04-13 00:34:05 +00:00
c39150df4d tls: make ctx_write function return the length of enqueue
Type: fix

Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
Change-Id: Ia8656fe2c48799e53c1b2c064009848ad3457659
2020-04-11 18:10:25 +00:00
35acaac184 fib: fix accessing empty dpo pool elements
Type: fix

Signed-off-by: ShivaShankarK <shivaashankar1204@gmail.com>
Change-Id: Iee88a2101ce42d7f1cdb65df532c349d14829e4c
2020-04-11 17:07:43 +00:00
256779c857 udp: remove connected udp transport proto
Type: refactor

To reproduce functionality, use udp in combination with
TRANSPORT_CFG_F_CONNECTED transport flag set in connect and listen
parameters.

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id88470c38326f8168b9646b0de49a674e0f4266f
2020-04-10 19:52:04 +00:00
92e131468b quic: fix clean stream close
Properly close the stream sending side instead of resetting the entire
stream.

Change-Id: I2daca7e507daa7bf9cd6a27fa8828a9ea7d175f9
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2020-04-10 17:04:46 +00:00
bc1a1a7347 udp: fix local node no port error counter
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie0c5a86aedfa38fdcbb835aee7c9e91d59b222d6
2020-04-10 15:23:02 +00:00
f50ef40acb virtio: fix gso and csum offload errors handling
GSO and CSUM offloaded packets are transmitted
even itf doesn't support GSO/CSUM. This patch
fixes it by logging the respective errors and
dropping the packets.

Type: fix

Change-Id: I5ab19d15ce6aa9fda515313c313a5a56c0b96837
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-04-10 12:22:29 +00:00
91fd910d7d geneve: Fix the byte swapping for the VNI
Type: fix

- swipe away the vomit indent left last time.
- add tests for VNIs > 16bit

Change-Id: I2d1f591bfb9d7a18996c38969365a509168d4193
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-04-10 12:21:30 +00:00
ae9c45938b fib: fix adjacency cli command issue
Type: fix

Signed-off-by: ShivaShankarK <shivaashankar1204@gmail.com>
Change-Id: I193023705003e664c50487fdfaa42b813604a078
2020-04-10 07:30:21 +00:00
12813d5e4a session: fix leak on accept fifo alloc failure
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia928d6ea05ff7cb9a15e1ddc58234d000ebfd7fb
2020-04-09 22:47:02 +00:00
573f44c2f5 tcp: avoid regrabing error node in input and output
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2dd0187d069783ac8bc445a70f99934d91ae0e63
2020-04-09 21:21:57 +00:00
6fe7b75f35 tls: adopt picotls engine to new session scheduling mechanism
Type: fix

Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
Change-Id: I58fea0474e293d5e6a029e0dccd4a24b07b76a90
2020-04-09 20:15:08 +00:00
6d7552ca88 session: update fifo slice on session migration
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic5fb0f95c58ad70925a365004fe911ac8f2d2382
2020-04-09 19:36:28 +00:00
98c2348b5c docs: Fix the Use Cases Index
Signed-off-by: John DeNisco <jdenisco@cisco.com>
Change-Id: If4d5ef8ab93c905493af074fb4c2096f1ab222d4
2020-04-09 14:23:35 -04:00
81767d71a9 vom: Fixes for g++-9
Type: improvement

Signed-off-by: neale ranns <nranns@cisco.com>
Change-Id: I356251b750fcab05ff91e0295e96a8451e8b2f88
2020-04-09 16:26:32 +00:00
f8f88eff66 misc: add a nerd knob to skip a sysctl during the .deb installation
In some cases, e.g. in the container installs, it's beneficial to skip
the sysctl portion of the installation.

This commit allows to do that by setting the environment variable
VPP_INSTALL_SKIP_SYSCTL.

Change-Id: If88468c5c45bf122e927f09e08560e25b73bf1f9
Type: feature
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-04-09 15:47:27 +00:00
92bbfc297c udp: fix coverity warning
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I8efde7a4be9b04eae7e30b153de5edab7854496b
2020-04-09 15:15:10 +00:00
ca57852168 bfd: always start timers with non-zero tick counts
Otherwise the tw_timer_template code ASSERTs...

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I85e00a3e3486e3b238254ac4116d684a32984434
2020-04-09 14:31:16 +00:00
7a90e500ba svm: use active fifo count in fifo test
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id6c9dbf65523274768173e288431d7dbac55676d
2020-04-09 14:26:13 +00:00
9cbfb4c513 mpls: fix typo in error path
if ip4_frag_do_fragment(...) returns an error due to buffer allocation
failure, we end up trying to increment a nonexistent counter, which
causes an ASSERT failure.

The second argument to vlib_error_count is a node index, not a
next index...

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ib0733b0d35bcb9d3ca6bd789e0c5ddc1561ce724
2020-04-09 11:45:05 +00:00
1adc7e78ad 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
2020-04-09 06:50:11 +00:00
e759bb543c udp: cleanup input node
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ida9daefc20a161b36d6f36c56267123c7f2efc01
2020-04-08 22:24:41 +00:00
8324c55f95 ping: fix buffer allocator error handling
The code sets f->n_vectors = n_to_send, but it can bail out of the
loop if vlib_buffer_copy(...) returns 0.

Need to fix f->n_vectors in the error return path, or we enqueue some
number of 0xfefefefe buffer indices in a debug image or worse in a
production image.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I2d886266006c6c1c2f9ef8e3b95eb46ac6c0b3df
2020-04-08 17:22:21 +00:00
954c707972 misc: check return values from vlib_buffer_copy(...)
vlib_buffer_copy(...) returns NULL if the system is temporarily out of
buffers.

This is NOT correct. Please don't be this person:

   c0 = vlib_buffer_copy (vm, p0);
   ci0 = vlib_get_buffer_index (vm, c0);

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ic25ef58965871ea5d2b40904df9506803f69e47e
2020-04-08 16:29:44 +00:00
8d0d8d2fcc gbp: More reliable unit-tests
Type: fix

the GBP unit tests would peridocially fail. The reason being that there
is dynamic state whose presence nneds to be created, tested and then
timeed out. The failures occurded when the timeout occured before the
state could be tested. the previous timeout was 2 seconds, this has been
doubled, as a result i saw no faliures running continuously for ~16
hours.
bumping the timer increasing the test run time from ~40 to ~53 seconds,
a small price to pay.

in test cases where the state is not timed out i bumped the timer to 60
seconds.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: I11b0970570caa8eebf486fe8cd8e44a4b2b1fc36
2020-04-08 15:26:33 +00:00
61717cc38f nat: use correct data types for memory sizes
Type: fix

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Id2d181385f109163d4c806eecda166c2087c4b92
2020-04-08 14:54:23 +00:00
7d69718543 virtio: fix the tcp/udp checksum offloads
Some vhost-backend calculates the wrong checksum in
case of tcp/udp offload when driver resets tcp/udp
checksum field to '0'.

Type: fix

Change-Id: I1d2a9b95b3d5cc1decac38027104a04df2af4680
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-04-08 14:40:33 +00:00
88cecfad98 ip: do not clear the locally-originated flag
Type: fix

 - doing so in MTU dec, means mtu_inc is broken
 - there's no need to. if a packet encounters ipX-rewrite a second time then it went through a tunnel the first time and is still locally originated.

Change-Id: I0f279c2837b608c1677485fe93f63398ab2737b3
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-04-08 08:28:06 -04:00