aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
AgeCommit message (Collapse)AuthorFilesLines
2020-08-12misc: fix coverity warningsDave Barach9-15/+18
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)
2020-08-12tls: remove session lookup operation in TLSYu Ping1-2/+0
Type: fix Change-Id: I50329bda365d98f9f9d56a58187fb4fb2a4eb461 Signed-off-by: Yu Ping <ping.yu@intel.com> (cherry picked from commit 985d9293a08dc3da016fbeeaa3f8fff10e1b504e)
2020-08-12session: avoid scanning new io list under loadFlorin Coras2-21/+51
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Idaa7cc26ad941be86daec4ed5920727237712f4a (cherry picked from commit 16d974ec59776f0103ad62d0d04dc57989eef7ed)
2020-08-12ip: fix ip-local errorsFlorin Coras3-3/+4
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie8bc5c9a03e858487cf565b4e9b520e6b496337a (cherry picked from commit fa2a316663e622a2feeecf8ad7d32b242370a70a)
2020-08-12tcp: fix input error countersFlorin Coras1-17/+30
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I87940d02813b66616f1944e41b16c8cc16f5dac0 (cherry picked from commit deb6f784edbaddd2e60e0d6ac9927f17c4214ad2)
2020-08-12ipsec: fix AES-GCM block sizeDamjan Marion1-3/+6
Type: fix Change-Id: I0c9640dab2c0eaba369bc8f3ff7ae56d8e97e170 Signed-off-by: Damjan Marion <damarion@cisco.com> (cherry picked from commit f1ecb6555326f8a7d5bba6f56aa676f064675dc0)
2020-08-12ip6: fix l4 checksum with hop-by-hop headerMatthew Smith1-13/+23
L4 checksums for IPv6 should be calculated using a pseudo header that includes the source/destination addresses, payload length, and payload protocol. ip6_tcp_udp_icmp_compute_checksum() was using the payload length and protocol from the IPv6 header. If there is a hop-by-hop header (or any other extension header), the payload length used for the pseudo header should only include the upper layer header and payload and not the extension header bytes. Same deal with the protocol, the upper layer next header value should be used instead of the extension header. Type: fix Fixes: cb9cadad57 Change-Id: Ifa2c9ad41c0fc4eea674f0671255b637c8e01f71 Signed-off-by: Matthew Smith <mgsmith@netgate.com> (cherry picked from commit 97677a26f7c857e7ee0acbdb2c13eef214aa70a8)
2020-08-12fib: fix non-NULL terminated vectors in cli outputBenoît Ganne2-2/+2
Type: fix Change-Id: Idbb3f29b13a5c84a8585c4299e51fdfc35f7e1ad Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit 84382ae45c2cf694ef7faf4a87d60c1546869301)
2020-08-12virtio: vhost gso is broken in some topologySteven Luong1-2/+8
Recent modification added a call to vnet_gso_header_offset_parser in the beginning of vhost_user_handle_tx_offload. The former routine may set tcp or udp->checksum to 0. While it is appropriate to set it to 0 for the GSO packet, it is broken and causes checksum error if the aformentiooned routine is called by a non-GSO packet. The fix is to not call vhost_user_handle_tx_offload if the buffer does not indicate checksum offload is needed. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I6e699d7a40b7887ff149cd8f77e8f0fa9374ef19 (cherry picked from commit 564e1672917e205d7ae79525bb937df18f8d764b)
2020-08-12session tcp: fix packet tracingFlorin Coras5-13/+15
Type: fix Change-Id: Ib823d016c64998779fb1d00b8aad3acb5e8340be Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit 30928f87a3c9d98e288d1364d50c032e052e69ab)
2020-08-12sr: fix possible null-pointer dereferenceIgnas Bacius1-1/+1
Steps to reproduce VPP crash: 1. configure localsid End behavior 2. ping the localsid address Type: fix Signed-off-by: Ignas Bacius <ignas@noia.network> Change-Id: Id780e0875ec9cdb25252217990919fb3dddbf06a (cherry picked from commit bd5c49a1615e36260a86184d087b5b47a5e747be)
2020-08-12classify: pcap / packet trace debug CLI bugsDave Barach2-1/+5
"classify filter trace ... " and "classify filter pcap ..." are mutually exclusive. vnet_pcap_dispatch_trace_configure needs to check for set->table_indices == NULL. Type: fix Ticket: VPP-1827 Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I43733364087ffb0a43de92e450955033431d559d (cherry picked from commit 196fce2b62c0d215722dd233aa8bf70a43aa0a66)
2020-08-12interface: Add missing ip4 udp->checksum = 0 prior to computing checksumSteven Luong1-1/+4
For ip4 tcp, ip6 tcp, and ip6 udp packet, we set checksum = 0 prior to computing the checksum. We missed ip4 udp case. This oversight requires all clients to set udp->checksum = 0 if ip4 udp checksum offload is needed. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ic608811e82099f3bec469e123671e9b281f38d76 (cherry picked from commit 03328ec8bb86b93fa70bb6b2a9b37c40e686a1f7)
2020-08-12session: fix node runtime in pre-input queue handlerFlorin Coras1-0/+1
Call session queue node with the right node runtime instead of the pre-input node runtime. Type: fix Change-Id: I43d20bed4930fc877b187ce7ecdce62034b393c5 Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit 2d8829cbb5f3d214fbc09bf4258573659e0c5e60)
2020-08-12classify: fix pcap filter set initFlorin Coras1-4/+2
Type: fix Change-Id: I6a48a6c14bfb84b3460e8211021bc9df6e915dba Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit cd681adab40f49d1305144b6bbbd5118e63a2805)
2020-08-12lb: fix that lb_add_del_vip and lb_add_del_as api doesn't work correctlyYulong Pei1-0/+9
Currently if user want to set ip4 address to the api, it must convert to ip6 format, e.g. user want to ip4 "90.1.2.1" but must convert to "::5A01:0201", it is not acceptable, this fix solved the issue. Ticket: FDIO-753 Type: fix Change-Id: I2ffa5a3d38400ee176cf601421074f71fc395f03 Signed-off-by: Yulong Pei <yulong.pei@intel.com> (cherry picked from commit db43bb6af78c33e47d29889b047cced4b11fe4d7)
2020-08-12sr: some fixes for SRv6 CLI/APIAhmed Abdelsalam2-4/+19
Return FIB table_id instead of vrf_index to clients Type: fix Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com> Change-Id: I76a97bad3ecd3ac8eb045efb1657eaa90c2a57b6 (cherry picked from commit 13e6fce7c5b3a16a6af0b27fc259ef3f65d8c861)
2020-08-12tcp: fix rxt delivered without sacksFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I69c245cb0e3f6d599a3270a485fa0a5845cde8eb (cherry picked from commit 56cef059ef44434efe26d523caec1bb0af9c1d3b)
2020-08-12udp: fix ipv6 listen port registrationFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7f2233eb9bf3d81a697f76ba985083cf1040e2e9 (cherry picked from commit ff2fad1701d8274d602cc46f3f2323154d96dc9f)
2020-08-12build: Add missing version.h dependency in vnetChris Luke1-1/+1
Two modules in vnet include vpp/app/version.h but there is no explicit build dependency for this generated file. This leaves a race condition in the build system that the Coverity build has recently started triggering. Change-Id: I8e2bb32feeb16e1bdd8efb0d2633cfdba60f51aa Type: fix Signed-off-by: Chris Luke <chrisy@flirble.org> (cherry picked from commit c171d01cdb5183c8bf640951e94af6b1fd5e3efc)
2020-08-12tcp: fix tcp check tx offload issueSimon Zhang1-2/+6
Type: fix Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com> Change-Id: I3b8755831d762abf51e1cbe1b57024f9297de9a4 Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com> (cherry picked from commit 79bfb9e09c7bf2072d34b2ed6159ba11815dab3a)
2020-08-12ip6: during icmp to icmp6 translation truncate error messagesAlexander Chernavin1-2/+2
All translated ICMPv6 packets that exceed the minimal IPv6 MTU get truncated but according to RFC 4443 2.4 only ICMPv6 error messages (type < 128) need to be truncated. With this commit, truncate only ICMPv6 error messages. Type: fix Change-Id: Ic455352de2ff4ff6aa3421b46a2a54923f2d3f80 Signed-off-by: Alexander Chernavin <achernavin@netgate.com> (cherry picked from commit 180210f99b74b97b127b7800bdc7bd243713cbf4)
2020-08-12tcp: handle ack advancement with no holes and renegingFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I9afba8dc9e087b8c436fe568531c02614a577a7c (cherry picked from commit c95eefb393d05167ce6e35e5617179f536de0bda)
2020-08-12ip: avoid fib lookup for consecutive pkts having same source IPNitin Saxena1-5/+5
Type: fix Fixes: be2286b0 This patch does following: - If terminating frame has consecutive packets with same source IP, this patch avoids fib lookup for those packets in ip4-local node. This drops cycle count for ip4-local node on both ARM and x86. It being done by enabling dead code in else {} case of ip4_local_check_src_x2() and ip4_local_check_src() functions. - In case all packets in terminating frame have unique source IP (e.g: incrementing), ip4-local is costlier by 2 cycles (broadwell) Change-Id: I472ddc324716cec8bfe601568b8aeb7565f97ab3 Signed-off-by: Nitin Saxena <nsaxena@marvell.com> (cherry picked from commit 2d18d2ea9f0e3d6c47d365ec135af651b14e8165)
2020-08-12fib: leverage well-optimized clib_memcpyZhiyong Yang3-6/+6
Type: fix Change-Id: I684910837ca4d9c8a07262459158bbb0423a33af Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> (cherry picked from commit d3d7ef5ec828ec895c6f90090118782e497b9084)
2020-08-12session: remove io event dispatch dbg msgFlorin Coras1-4/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I166ab7b96444587a3252925d3a28505e0db52d74 (cherry picked from commit 87b0c892947006cbfa80fd2af15e8edb4029f327)
2020-08-12tcp: fix persist assertFlorin Coras1-4/+1
Type: fix Persist and retransmit can pop at the same time. Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ia9530645cc84c83a881a75d7b4627197dc50ed29 (cherry picked from commit a6696719cb9fcd8ab54a5007e91dac6aeffe4e70)
2020-08-12tcp: fix scoreboard assertFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3c70b331932708a1b773392e089aed9dba9b3b31 (cherry picked from commit edf1da94dc099c6e2ab1d455ce8652fada3cdb04)
2020-08-12tcp: fix last sacked with no holesFlorin Coras1-0/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id12b0a9b8bc47aef8b393544e5b4c8228ed6a606 (cherry picked from commit 479f7fec6a876bf06f6007c03fd7b9fa3404df54)
2020-08-12tcp: fix duplicate sack whith renegingFlorin Coras1-6/+9
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I6f7fb91e059996ff702eb9c36e3abaed237fe221 (cherry picked from commit 067f8f963d64b1cbc70f2b78ebd2c6d3791e7d22)
2020-08-12tcp: fix rate samples for old acksFlorin Coras1-2/+24
Type: fix Change-Id: Ieab35bbfba81faae61b1267d8661df5195877824 Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit 2f04cb9f142abef82cd379432cecdafef9e776db)
2020-08-12tcp: accept sack reneging as a cc eventFlorin Coras1-4/+4
Type: fix Change-Id: Iead1303ca3dec7593eb3ce54f291b82d94c821a4 Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit 1de7167e7a12a80cc5996959aeb1fbe4b2853ccb)
2020-08-12interface: Prevent bad inner-dot1q any exact-match configurationJon Loeliger2-3/+13
Someone much more knowledgeable than I wrote: For L3 IP forwarding, any VLAN tags on a packet must be exact match to a sub-interface which means both outer and inner VLAN tag IDs must be exact-matched to specific values defined of that sub-interface. Without exact match on a L3 sub-interface, VPP has no mechanism to know what VLAN tags to use for packet output, such as ARP request packets or IP packets, on that sub-interface. Thus, sub-interface with "inner-dot1q any" is not an exact match sub-interface by definition since no match is present on inner tag. While in the area, fix a memory leak that would ensue on poorly configured interfaces. Change-Id: I8d17a96dbca3e3724c297ecc935ca61764e6ce2e Type: fix Signed-off-by: Jon Loeliger <jdl@netgate.com> (cherry picked from commit b22e1f06bbebc48ec72ce8effa529e69ffbb12ca)
2020-08-12pg: don't leak open files in packet-generatorChristian E. Hopps1-0/+3
Fix pg code to close it's open file descriptors before zero'ing the pcap_main structure for re-use. Ticket: VPP-1780 Type: fix Signed-off-by: Christian E. Hopps <chopps@chopps.org> Change-Id: I32945c6476ae83b8d210ee67ac78db3e8f786f46 (cherry picked from commit 19871f25394fa9a4bfb55006092cbcc28b446c04)
2020-08-12vxlan geneve gtpu: fix short helpPaul Vinciguerra4-4/+4
Type: fix Change-Id: Id53eb6ed15f270d747b9831a7b585cbafe515dd2 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com> (cherry picked from commit 5fb2278cb8badbbfe727acbdcaeda008a7fd2833)
2020-08-12ip: cleanup punt socket cli helpPaul Vinciguerra1-11/+20
Make the help string consistent with the cli parser. Type: fix Change-Id: I7140bd589c2a94dbf5af5cc633cb495457a6af22 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com> (cherry picked from commit 32c4d38f7ac6fe22abb0b4859f6075bb9b661773)
2020-08-12feature: add descriptive cli command output for 'set interface feature'Paul Vinciguerra1-7/+23
DBGvpp# set interface feature local0 arp-foo arc bad-arc set interface feature: Unknown arc name (bad-arc)... DBGvpp# set interface feature local0 arp-foo arc arp set interface feature: Feature (arp-foo) not registered to arc (arp)... See 'show features verbose' for valid feature/arc combinations. DBGvpp# set interface feature local0 arp-disabled arc arp Type: fix Change-Id: I036bb2a75dd2d40f6901e4fde3eb14925238e19b Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com> (cherry picked from commit a4e2e7cc95250220e0d892eb11dcc0adc9fd7e22)
2020-08-12feature: add [verbose] to show features helpPaul Vinciguerra1-1/+1
Type: fix Change-Id: Idf694477c18852e5541c28a493a56b302122e46c Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com> (cherry picked from commit baa171041bc950f192c147f7b79a8add2299b74a)
2020-08-12classify: forbid invalid match configBenoît Ganne1-0/+3
Forbid too long match to be configured. Type: fix Change-Id: Icfced0f86821d5febd6a3c81e1315bd9737498c0 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit 71a70d73f34f7c057dd95dbca39fb8e602087a75)
2020-08-12l2: fix l2input_feat_names overflowBenoît Ganne1-1/+1
Type: fix Change-Id: I59549b3aab5a0ccfe7db02757f78528e028121a5 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit 70ef0faea9f706004c068fb843797a7cb08a9e68)
2020-08-12ipsec: Init salt value in SA creation CLI (so it's not random)Neale Ranns1-0/+1
Type: fix Change-Id: Idf4d0b59a1eb2c739a67a4786470884050f81561 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 8dc75c0cc3ac0db13778a0a32f9aa81597b80556)
2020-08-12ipsec: make sure pad_bytes does not exceed pad data sizeBenoît Ganne1-1/+5
This helps GCC understand the memcpy will not overflow pad_data. GCC-6 (default on Debian 9) in particular got confused. Type: fix Change-Id: I176eb01531b9d5c7ebec40f015e510b2d56e77c4 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit 4505f0154eaba59c432c869b65e2dc493837032a)
2020-08-12ip: coverity fixjohny1-8/+6
Delete Null-checking "p0" in function ip6_tcp_udp_icmp_bad_length, because it's not necessary. Type: fix Signed-off-by: johny <jan.cavojsky@pantheon.tech> Change-Id: I2bf43a60c1c1d76e42581df27f2285c9e9563093 (cherry picked from commit a633a4318bea2f9edcb80d9685b0f811cac679ea)
2020-08-12session: close for reset replies independent of stateFlorin Coras1-2/+2
Type: fix Change-Id: I8b8875f1dc9203dfbb443ac43df8250cbb0b1edc Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit f1910326d537ad7692d4a9b807ebbef93106acea)
2020-08-12tcp: fix tail rescue with sacksFlorin Coras1-5/+7
Type: fix Change-Id: Iad73f47cef3d29c4b0b7d1f58f2f2b14ba4b1d38 Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit 3eba7f1575a17b77924bf5be67b03b0227d04b78)
2020-08-12ip: fix cancel termination after receive malformed ip6 packetjohny2-5/+68
This fix is for cancel termination of vpp after receive malformed packet type of ip6.To avoid termination of vpp are checked if are missing data in packet. This occours, when payload length in ip6 header packet is more than real count of data in packet. When this error occours, packet is ignore. Type: fix Ticket: VPP-1693, VPP-1694 Change-Id: I9d9ecea7b75c8702cb31aa8051c8d4d7ce19659d Signed-off-by: johny <jan.cavojsky@pantheon.tech> (cherry picked from commit 17478e4eb81d384f171ca27c9110a051cd434f16)
2020-08-12ip: init l3_hdr_offset when pushing an ip4 headerFlorin Coras1-6/+4
Type: fix Change-Id: I87503b9a981724b1f3ff1c45a4a5f7a43024ca76 Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit 757de9873bbaf2d21d107da42c6bbeb2804c7fcc)
2020-08-12flow: fix several crash issuesChenmin Sun1-0/+6
Type: fix This patch fixes crash issues(marked in brackets) in the below test cases test flow enable index 0 1/1 -> [crash] test flow disable index 0 1/1 -> [crash] test flow add src-ip 192.168.8.8 proto udp redirect-to-queue 8 test flow enable index 0 1/1 test flow disable index 0 1/1 - [crash] test flow add src-ip 192.168.8.8 proto udp redirect-to-queue 8 test flow enable index 0 1/1 test flow enable index 0 1/2 test flow del index 0 -> [crash] Signed-off-by: Chenmin Sun <chenmin.sun@intel.com> Change-Id: I84bc6faa3d93a2cab4c82e8a876a8b1067257b62 (cherry picked from commit be2ad0b4743ed8a3875a5b6039c10c66eb07614c)
2020-08-12fib: Another realloc burnNeale Ranns1-5/+13
Type: fix harmless this time since it only affects the debug statement, but it still crashes an ASAN image. Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: Ie02e7fe3014b98b9f8c83447f59017a380ab3948 (cherry picked from commit 981a690b7d25c96ea56f95ece693377f95b93fc1)
2020-08-12tcp: invalidate expired timer handles before dispatchingFlorin Coras3-25/+29
Type: fix Change-Id: Icc8cd05cb9c1844a9f8b0399797ad554f4ccf1a1 Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit b72a0ff73514ec7ea79ed3fad49b77d56b248642)