aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/reass/ip6_sv_reass.c
AgeCommit message (Collapse)AuthorFilesLines
2024-03-12misc: remove GNU Indent directivesDamjan Marion1-19/+0
Type: refactor Change-Id: I5235bf3e9aff58af6ba2c14e8c6529c4fc9ec86c Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-10-05ip: reassembly - custom context of ipv6Mohammed Hawari1-26/+128
Change-Id: Ia5ec7fc0c71e6a0ad1b43df24bb6b88e616d260d Type: improvement Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2022-08-11ip: Use .api declared error countersNeale Ranns1-17/+10
Type: improvement Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: I822ead1495edb96ee62e53dc5920aa6c565e3621
2022-04-04vppinfra: make _vec_len() read-onlyDamjan Marion1-2/+3
Use of _vec_len() to set vector length breaks address sanitizer. Users should use vec_set_len(), vec_inc_len(), vec_dec_len () instead. Type: improvement Change-Id: I441ae948771eb21c23a61f3ff9163bdad74a2cb8 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-12-20ip: SVR fix race conditionKlement Sekera1-1/+7
There could be a race condition where two fragments of one chain end up at the same time on different workers, one overwriting others hash entry. Add a check for that and restart processing on the unlucky worker who ends up being second from hash table POV. This will then result in a proper handover to worker now owning this reassembly. Type: fix Fixes: de34c35fc73226943538149fae9dbc5cfbdc6e75 Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I9eb29c5cb1ffe3b5eb1d5a638e17ab7ba2628d28
2021-12-14ip: reassembly: drop zero length fragmentsKlement Sekera1-0/+8
Zero length fragments are invalid and should be dropped. This patch adds that. Type: improvement Change-Id: Ic6466c39ca8bf376efe06bb3b7f5d7f1ae812866 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2021-12-10ip: reassembly: handle atomic fragments correctlyKlement Sekera1-5/+16
If a fragment arrives with fragment offset = 0 and M = 0, it means that this is actually a complete packet and per RFC 8200, it should be treated independently from other fragments. This patch does that. Fragmentation header is stripped and fragment is forwarded irregardles of other existing reassemblies in case of full reassembly and treated the same way as regular packet in shallow virtual reassembly. Type: improvement Change-Id: If3322d5e3160cd755b8465a642702a9166d46cc2 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2021-12-03ip: extension header parsing fails for fragment headerOle Troan1-26/+22
Refactor and improve boundary checking on IPv6 extension header handling. Limit parsing of IPv6 extension headers to a maximum of 4 headers and a depth of 256 bytes. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: Ide40aaa2b482ceef7e92f02fa0caeadb3b8f7556 Signed-off-by: Ole Troan <ot@cisco.com>
2021-11-04ip: speed up reassembly code compilationKlement Sekera1-13/+9
Refactor code so that code is inlined in one place instead of in multiple to speed up compilation. Type: refactor Change-Id: I41357b89715b66ebdc8c0d5ccd69347a254fc266 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2021-11-04ip: reassembly: avoid reading truncated L4 headersKlement Sekera1-4/+5
Check if L4 headers are truncated and if so, set a flag for (future) consumers instead of reading/writing garbage data. Type: fix Fixes: de34c35fc73226943538149fae9dbc5cfbdc6e75 Change-Id: I0b656ec103a11c356b98a6f36cad98536a78d1dc Signed-off-by: Klement Sekera <ksekera@cisco.com>
2021-08-17ip: reassembly cleanupKlement Sekera1-58/+32
Remove unused parameters and fix warnings. Type: fix Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I2d0e7b84b56817999283ecb6be606159dcb26a28
2021-05-14vlib: pass node runtime to vlib_buffer_enqueue_to_thread()Damjan Marion1-3/+2
Mechanical change for patch following this one... Type: improvement Change-Id: Iee12f3a8851f35569e6c039494a94fc36e83d20f Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-04-01ip: extend show cmd of ip reassembly configurationAnton Nikolaev1-0/+4
Type: feature Add output of field maximum reassembly length with others ip reassembly configuration fields. This field can be configured via vpp API, but there was no output of this field in vpp cli. Output added for ipv4/ipv6 and full/shallow virtual nodes. Signed-off-by: Anton Nikolaev <anikolaev@netgate.com> Change-Id: Ibbd61aab26189d4a93d32e047d8f4e589fe9f8a5
2020-12-27ip: Use full reassembly for fragments in ip6-localNeale Ranns1-2/+0
Type: fix shallow was the default, but probably by accident as it depended on module load order. full assembly is the v4 behaviour. using proper types allows gdb to print enum names. Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: If157c5b83614c7adbd7a15a8227a68f8caf4e92c Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-12-16ip: fix possible missing trace indexesKlement Sekera1-0/+7
Add safeguards when tracing packets to avoid cases where clear trace was issue while buffers were held in reassembly. Type: fix Change-Id: I1bdd1e629e8bc08ce63913fd3c4b2327e47dec04 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2020-12-14misc: move to new pool_foreach macrosDamjan Marion1-4/+4
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-06-10ip: reassembly: LRU algorithm should eliminate the longest unused nodeszhengdelun1-1/+1
Type: fix Signed-off-by: zhengdelun <xszhengdelun@gmail.com> Change-Id: I3f6240b4c0798f85960acc55a193a0cbf0c67ea4
2020-04-29ip: use thread local vm instead of thread main for vlib_time_now callsTom Seidenberg1-1/+1
Type: fix Change-Id: I8d68e7c7392dcb748a2a84e72c7b1ca0c6c0eb07 Signed-off-by: Tom Seidenberg <tseidenb@cisco.com>
2020-04-24ip: reassembly: improve type safetyKlement Sekera1-9/+8
Type: refactor Change-Id: Ib2d4a11ffa0e1e56ca05705ba8cdf84e6cc66427 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2020-04-06ip: reassembly: don't set error if no errorKlement Sekera1-3/+2
Type: fix Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I9d25129fbf1ea880121b281f41750155286fb489
2020-02-10ip: more detailed show reassembly commandsVladimir Ratnikov1-2/+9
Options like: expire_walk_interval_ms,max_reassemblies,timeout_ms can be configured via API, but it's impossible to check them using vppctl, but this can be a useful feature Type: feature Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com> Change-Id: Iac8a96201a7a70b82e9852edc89b819c5d451a58
2020-01-15ip: align reass.save_rewrite_lengthv20.05-rc0Klement Sekera1-9/+0
By aligning vnet_buffer_opaque.ip.save_rewrite_length and vnet_buffer_opaque.ip.reass.save_rewrite_length we prevent shallow virtual reassembly code from overwrite save_rewrite_length, allowing other features down the pipe to rely on this value. A static assert is added to guard this alignment. Type: fix Fixes: f126e746fc01c75bc99329d10ce9127b26b23814 Change-Id: Ie7c7f3abc2a221bbcf2830c0f006a4368088b342 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2020-01-03nat: use SVRKlement Sekera1-23/+77
Remove NAT's implementation of shallow virtual reassembly with corresponding CLIs, APIs & tests. Replace with standalone shallow virtual reassembly provided by ipX-sv-reass* nodes. Type: refactor Change-Id: I7e6c7487a5a500d591f6871474a359e0993e59b6 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-12-16vppinfra: bihash walk cb typedef and continue/stop controlsNeale Ranns1-1/+2
Type: feature Change-Id: I28f7a658be3f3beec9ea32635b60d1d3a10d9b06 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-12-13ip: SVR: fix wrong return valueKlement Sekera1-1/+1
Type: fix Change-Id: I9498b660bf2045bb6aac96d19bb9456a14b35847 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-10-28ip: reassembly fix sanity checksKlement Sekera1-2/+2
use correct value for sanity checks Type: fix Change-Id: If33db5ce3e4a26f7876c2a67832ca2947563e211 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-10-07ip: remove dead code in ip6-svrKlement Sekera1-27/+0
Type: fix Fixes: de34c35fc73226943538149fae9dbc5cfbdc6e75 Change-Id: Ia714c2e46627864091d3f686dbced4cdd9c1a773 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-10-07ip: reassembly add missing gotoKlement Sekera1-0/+1
Type: fix Fixes: de34c35fc73226943538149fae9dbc5cfbdc6e75 Change-Id: I256ef153b3b27a1f7ab7daa45015a2ec4bc84076 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-10-07ip: reassembly remove dead codeKlement Sekera1-8/+0
Type: fix Fixes: de34c35fc73226943538149fae9dbc5cfbdc6e75 Change-Id: I79589f648f4c75762e5277fb94636a91fa36ccdd Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-09-30ip: svr: fix feature refcountsKlement Sekera1-7/+10
Reference counts need to be per-interface as opposed to global. This allows configuring the feature on more than one interface correctly. Type: fix Fixes: de34c35fc73226943538149fae9dbc5cfbdc6e75 Change-Id: I05534ac59fa86e67290737ec6c61df2c19acab48 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-09-26ip: add shallow virtual reassembly functionalityKlement Sekera1-0/+1332
Type: feature Change-Id: Ibc8334e26c7e6f6120696c3e313b6e11d73dab99 Signed-off-by: Klement Sekera <ksekera@cisco.com>