aboutsummaryrefslogtreecommitdiff
path: root/tests/sys/netinet/libalias
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-231-1/+0
| | | | | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/ Similar commit in main: (cherry picked from commit d0b2dbfa0ecf)
* Cast pointer to uintptr_t to avoid alignment warnings.John Baldwin2022-05-111-3/+3
| | | | | | | | | | | | Both struct ip and struct udphdr both have an aligment of 2, but the cast from struct ip to a uint32_t pointer confused GCC 9 into raising the required alignment to 4 and then raising a -Waddress-of-packed-member error when casting to struct udphdr. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D31941 (cherry picked from commit dba02df30d536922727a7ea509514462452a247a)
* tests/libalias: PortrangeLutz Donnerhacke2022-01-032-2/+57
| | | | | | | | | | | | | | Test ranges of allowed ports for aliasing. - Explicit default like ipfw(8) is doing - Regular range - Exhausting a very small range - Recovery Includes a fix of an utility macro, which was not used before. Differential Revision: https://reviews.freebsd.org/D31012 (cherry picked from commit 2c733b50c5a99cbe4f6eef437e1e3efd720ba306)
* tests/libalias: Make inline functions static inlineDimitry Andric2021-12-271-2/+2
| | | | | | | | | | In C, plain inline functions should never be used: they should be declared either static inline or extern inline. In this case, they are clearly meant to be static inline. MFC after: 3 days (cherry picked from commit 46aec7fae47ed46368f95338741b4daffa5cbc94)
* tests/libalias: Bugfix in used variablesLutz Donnerhacke2021-07-051-2/+2
| | | | | | Fix two copy and waste errors (referencing the wrong variable). (cherry picked from commit b3dc6f137b8d626c4415a5fa9c9874ac4ca78658)
* tests/libalias: Test LibAliasIn and redirectionLutz Donnerhacke2021-06-026-217/+668
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework the tests to check the correct layer in a single test. Factor out tests for reuse in other modules. Extend the test suite for libalias(3) to incoming connections. Test the various types of redirections. gettimeofday(3) is almost as expensive as the calls to libalias. So the call frequency for this call is reduced by a factor of 1000 in order to neglect it's influence. Using NAT entries became more realistic: A communication of a random length of up to 150 packets (10% outgoing, 90% incoming) is applied for each entry. Add port forwardings to the performance tests. This will cause random incoming packets to match the random port forwardings opends beforehand. After a long test run, a lot of ressouces have been allocated. Measure the time tot free them. Reviewed by: kp (partially) Differential Revision: https://reviews.freebsd.org/D30412 Differential Revision: https://reviews.freebsd.org/D30408 Differential Revision: https://reviews.freebsd.org/D30405 Differential Revision: https://reviews.freebsd.org/D30443 (cherry picked from commit f1462ab0512c1a0e59f03a7a145df2889bed2997) (cherry picked from commit 755bab6d55e6e2df168f352f3e2fbdea87002ed8) (cherry picked from commit 6e87898a2c7e99937656a0c12d03333a43a10c5e) (cherry picked from commit d62e1ecba07b2acee37e019778087f0f55d977d1) (cherry picked from commit 5434ebd256a08e452dec376c1488abdf7ff02af8) Fix various bugs: (cherry picked from commit ccac04cae538a625cbce224e4005360fa85e1b9d) (cherry picked from commit 7b8696bf128754712a24ba98ce2d88eed2ee68dc) (cherry picked from commit fef99da69f983566de3cb8ad4a1b8decc31348ce) (cherry picked from commit f4c460dacdda5c6e1896a0c51d6096c4f3417b32)
* tests/libalias: Reduce stressLutz Donnerhacke2021-05-301-1/+1
| | | | | | | Due to the new, external performance test utility, the regular test suite can reduce the stress test to a fair amount of activity. (cherry picked from commit a660948b7b2d875591aba3713620424c51330038)
* test/libalias: Tests for instantiation and outgoing NATLutz Donnerhacke2021-05-296-0/+971
In order to modify libalias for performance, the existing functionality must not change. Enforce this. Testing LibAliasOut functionality. This concentrates the typical use case of initiating data transfers from the inside. Provide a exhaustive test for the data structure in order to check for performance improvements. In order to compare upcoming changes for their effectivness, measure performance by counting opertions and the runtime of each operation over the time. Accumulate all tests in a single instance, so make it complicated over the time. If you wait long enough, you will notice the expiry of old flows. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D30307 Differential Revision: https://reviews.freebsd.org/D30335 Differential Revision: https://reviews.freebsd.org/D30379 (cherry picked from commit 7fd8baee756efa18b6bbb17cbf3a652eb2058d87) (cherry picked from commit c1fbb54f4b100d576da7ab065d1887a21f691936) (cherry picked from commit 33c1bdfc3e098862100bab7a8dc729d8c78ffa7c)