aboutsummaryrefslogtreecommitdiff
path: root/tests/sys/netinet6
Commit message (Collapse)AuthorAgeFilesLines
* ndp tests: Fix flakiness in ndp_slaac_default_routeMark Johnston2026-02-171-2/+5
| | | | | | | | | | | The test sends RAs in order to test SLAAC handling in another host. The router needs to also set net.inet6.ip6.forwarding=1, otherwise NAs sent from it have the ROUTER flag clear, and upon receiving such an NA the host will automatically delete routes learned from the router. Fixes: feda329622bc ("netinet6 tests: Add a regression test for default router handling") MFC after: 1 week Sponsored by: Klara, Inc.
* ndp tests: Fix an assertion in ndp_prefix_lifetime_extendMark Johnston2026-02-171-2/+2
| | | | | | | | | | | | | Here we have two interface addresses sharing a v6 prefix with finite lifetime. The intent was to make sure that adding the second address didn't cause the prefix's valid lifetime to drop from 20s to 10s, but of course, while the test is running it may drop from 20s to 19s, causing the test to fail spuriously. Relax the check a bit to avoid this. PR: 293152 Fixes: 74999aac5eff ("in6: Modify address prefix lifetimes when updating address lifetimes") MFC after: 1 week Sponsored by: Klara, Inc.
* ip6_output tests: Remove an unused importMark Johnston2026-01-301-1/+0
| | | | | | | | No functional change intended. MFC after: 1 week Sponsored by: Stormshield Sponsored by: Klara, Inc.
* in6: Modify address prefix lifetimes when updating address lifetimesMark Johnston2026-01-121-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When one uses SIOCAIFADDR_IN6 to add a v6 address, it's possible to set the preferred and valid lifetimes of the address. If the address already exists, this ioctl will recalculate and update the expiry times based on the provided timestamps. When adding a new address, the lifetimes are inherited by the prefix as well, but only if we create a new prefix. If the prefix already exists, as it will in the case where an address is being updated rather than being added, we do not touch the prefix lifetimes at all. This means that the original address lifetime still applies to the route associated with that prefix, so when the prefix expires, the route goes away. This behaviour doesn't make a lot of sense: if the admin updates an address lifetime, we should ensure that the prefix lifetime is updated too. Make that change, ensuring that we do not shorten the prefix lifetime, as the prefix might be shared among multiple interface addresses. Add a regression test. Co-authored by: Franco Fichtner <franco@opnsense.org> Reviewed by: pouria, zlei, ae MFC after: 2 weeks Sponsored by: OPNsense Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D54562
* ifconfig: Fix the -L flag when using netlinkMark Johnston2025-12-192-1/+72
| | | | | | | | | | | | | | | | | | By default, when ifconfig shows a v6 address derived from a router-advertised prefix, it shows the initial preferred and valid lifetimes. When -L is specified, it is supposed to show the remaining lifetimes, but this was broken in the conversion to netlink. Fix that, and add a regression test which validates ifconfig output before and after a short-lived address expires. Reported by: Franco Fichtner <franco@opnsense.org> Reviewed by: melifaro, allanjude, Seyed Pouria Mousavizadeh Tehrani Fixes: 4c91a5dfe483 ("ifconfig: make interface and address listing use Netlink as transport") MFC after: 2 weeks Sponsored by: OPNsense Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D54294
* tests: Fix style in ra.pyMark Johnston2025-12-191-10/+12
| | | | | | No functional change intended. MFC after: 2 weeks
* Unskip test sys.netinet6.frag6.frag6_07.frag6_07Siva Mahadevan2025-12-161-3/+0
| | | | | | | | | This is now consistently passing with 100+ consecutive runs. Signed-off-by: Siva Mahadevan <me@svmhdvn.name> PR: 244170 MFC after: 3 days Sponsored by: The FreeBSD Foundation
* netinet6 tests: accept an RA on an interface without /64 addressKristof Provost2025-10-021-0/+39
| | | | | | | Excercise the code introduced in 9e792f7ef729 ("sys/netinet6: Fix SLAAC for interfaces with no /64 LL address"). Sponsored by: Rubicon Communications, LLC ("Netgate")
* netinet6: allow binding a raw socket to an anycast addressLexi Winter2025-07-151-0/+25
| | | | | | | | | | | Raw sockets have a separate check for this in rip6_bind() that was missed in the previous change. This fixes e.g. 'ping -S' using an anycast address. Fixes: ca4b046105f6 ("netinet6: allow binding to anycast addresses") Reviewed by: tuexen, kevans, des (previous version) Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D50438
* netinet6 tests: fix typo in the testK Rin2025-04-091-5/+1
| | | | | | | | | This caused sys.netinet6.redirect:valid_redirect to fail. PR: 247729 Fixes: eddfb2e ("Fix IPv6 regression introduced by r362900.") Reviewed by: jlduran, kp Pull Request: https://github.com/freebsd/freebsd-src/pull/1646
* netinet6 tests: add a test for SIOCAIFADDRing an invalid IPv6 addressLexi Winter2025-04-082-1/+49
| | | | Reviewed by: kp
* tests: Require python3 when using ScapyJose Luis Duran2025-03-038-13/+13
| | | | | | | | | | | | | | | python3 is a symbolic link that points to the current python 3.X version. It is possible for a system to have python (python 3.X) without the python3 (symlink) package. Test scripts that use Scapy are invoked using python3, so add it as a required program. Reviewed by: ngie, asomers Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D49007
* netinet6 tests: Add Scapy as a required programJose Luis Duran2025-02-171-3/+3
| | | | | | | | | | | | | | | The ra.py script requires Scapy. Invoke it using the python3 symlink. While technically, at the moment, python points to python3, and python3 points to the current version of python, it is recommended to use python3. No functional change intended. Add the Scapy requirement in the header of each test that makes use of it. Reviewed by: kp Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49005
* netstat: restore printing the "default" keyword, provide -nn optionGleb Smirnoff2025-02-031-3/+3
| | | | | | | | | | | | | | | Avoid POLA breakage and preserve output standard that really predates the FreeBSD project itself. There are scripts in the wild that rely on the behavior. Provide option to specify -nn twice to have a completely numeric output of the routing tables. Fixes: 9206c79961986c2114a9a2cfccf009ac010ad259 This reverts commit e090646d6f5a4a6848ecd4bcb1f2db498ea3b3e2. Reviewed by: zlei, gallatin, melifaro, allanjude, markj, emaste Differential Revision: https://reviews.freebsd.org/D48729
* divert tests: Stop skipping ipdivert_ip6_output_remote_successMark Johnston2025-01-231-5/+0
| | | | | | | | It passes after commit ce52baebd3b3 ("icmp6: Fix ICMP6 message type counters"). PR: 279975 Sponsored by: Klara, Inc.
* ndp tests: Update to chase commit 9206c79961986Mark Johnston2024-11-291-3/+3
| | | | | | | | "netstat -rn" no longer prints the default route using symbol names, but the test relied on it. Update it to look for ::/0 instead. MFC after: 1 week Fixes: 9206c7996198 ("usr.bin/netstat: -n should not print symbolic names")
* netinet: handle blackhole routesKristof Provost2024-11-201-0/+54
| | | | | | | | | | | | | | If during ip_forward() we find a blackhole (or reject) route we should stop processing and count this in the 'cantforward' counter, just like we already do for IPv6. Blackhole routes are set to use the loopback interface, so we don't actually incorrectly forward traffic, but we do fail to count it as unroutable. Test this, both for IPv4 and IPv6. Reviewed by: melifaro Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D47529
* netinet tests: Make some tests more reliable when run in parallelMark Johnston2024-09-091-1/+17
| | | | | | | | | | | | | | | | | | | Many of the modified tests add epair interfaces to the host, though most of the tests themselves run in a VNET jail. scapy in particular becomes unhappy when the list of interfaces changes as it is running, so, to improve reliability of parallel test runs, isolate tests which add epairs to the host. Also serialize arp tests, as they examine the dmesg as part of the test. The list of modified tests is not exhaustive, it was determined by running the test suite with parallelization enabled and looking at failures. It may be easier to just automatically enable VNET jailing of all netinet tests, but let's be more particular for now. Reviewed by: kp MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46606
* netinet6 tests: Add a regression test for default router handlingMark Johnston2024-07-253-21/+143
| | | | | | | | | | This serves as a regression test for commit a48df53e4249. Reviewed by: bz, allanjude MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Bell Tower Integration Differential Revision: https://reviews.freebsd.org/D46136
* Remove residual blank line at start of MakefileWarner Losh2024-07-152-2/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* sys.netinet6.divert.ipdivert_ip6_output_remote_success failsWarner Losh2024-06-241-0/+4
| | | | | | | | | Disable it. It's been failing with the useful 1 != 0 (1 != 0) for weeks if not months now. PR: 279975 Sponsored by: Netflix
* netinet6 tests: Restore an atf_check invocationMark Johnston2024-01-271-1/+1
| | | | | | | This one has been commented out since the initial commit, but doesn't appear to pose any problems. MFC after: 1 week
* frag6 tests: SerializeMark Johnston2023-12-311-0/+2
| | | | | | | I'm not sure exactly why, but these tests consistently fail when run in parallel. Serialize them for now. MFC after: 1 week
* Skip sys.netinet6.frag6.frag6_19.frag6_19 in CILi-Wen Hsu2023-11-061-0/+3
| | | | | | | This test case is unreliable in CI environment. PR: 274941 Sponsored by: The FreeBSD Foundation
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-1659-59/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* netinet6 tests: test for loss of Solicited-node multicast groupsKristof Provost2023-07-241-0/+40
| | | | | | | | | | | | The multicast code has an issue where it can lose the Solicited-node multicast group subscription if the same address is added twice. Test for this. PR: 233683 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D41123
* netinet6: make IPv6 fragment TTL per-VNET configurable.Alexander V. Chernikov2023-06-0112-14/+18
| | | | | | | | | | Having it configurable adds more flexibility, especially for the systems with low amount of memory. Additionally, it allows to speedup frag6/ tests execution. Reviewed by: kp, markj, bz Differential Revision: https://reviews.freebsd.org/D35755 MFC after: 2 weeks
* testing: improve python vnet wrapper.Alexander V. Chernikov2022-12-291-15/+15
| | | | | | | | | | | | | | | | * Derive jail name from class name and method name, instead of just method name. This change reduces the chances of different tests clashing. Old: 'jail_test_one'. New: 'pytest:TestExampleSimplest:test_one' * Simplify vnetX_handler() method signature by skipping obj_map (unused) and pipe. The latter can be accessed as the vnet property. * Add `send_object()` method as a pair to the `wait_object` inside the VnetTestTemplate class. * Add `test_id` property to the BaseTest method. Previously it was provided only for the VnetTestTemplate class. This change makes the identifier easily accessible for all users. MFC after: 2 weeks
* netinet6: fix interface handling for loopback trafficAlexander V. Chernikov2022-07-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Currently, processing of IPv6 local traffic is partially broken: link-local connection fails and global unicast connect() takes 3 seconds to complete. This happens due to the combination of multiple factors. IPv6 code passes original interface "origifp" when passing traffic via loopack to retain the scope that is mandatory for the correct hadling of link-local traffic. First problem is that the logic of passing source interface is not working correcly for TCP connections, resulting in passing "origifp" on the first 2 connection attempts and lo0 on the subsequent ones. Second problem is that source address validation logic skips its checks iff the source interface is loopback, which doesn't cover "origifp" case. More detailed description is available at https://reviews.freebsd.org/D35732 Fix the first problem by untangling&simplifying ifp/origifp logic. Fix the second problem by switching source address validation check to using M_LOOP mbuf flag instead of interface type. PR: 265089 Reviewed by: ae, bz(previous version) Differential Revision: https://reviews.freebsd.org/D35732 MFC after: 2 weeks
* netinet6: factor out cached route lookups from selectroute().Alexander V. Chernikov2022-07-081-1/+0
| | | | | | | | | | | | | Currently selectroute() contains two nearly-identical versions of the route lookup logic - one for original destination and another for the case when IPV6_NEXTHOP option was set on the socket. Factor out handling these route lookups in a separation function to improve readability. This change also fixes handling of link-local IPV6_NEXTHOPs. Differential Revision: https://reviews.freebsd.org/D35710 MFC after: 2 weeks
* netinet6: add ip6_output() scope testsAlexander V. Chernikov2022-07-081-0/+106
| | | | Differential Revision: https://reviews.freebsd.org/D35742
* netinet6: add ip6_output() tests.Alexander V. Chernikov2022-07-072-0/+436
| | | | Differential Revision: https://reviews.freebsd.org/D35708
* netinet6: fix ndp proxyingKUROSAWA Takahiro2022-05-302-1/+224
| | | | | | | | | | | | | | We could insert proxy NDP entries by the ndp command, but the host with proxy ndp entries had not responded to Neighbor Solicitations. Change the following points for proxy NDP to work as expected: * join solicited-node multicast addresses for proxy NDP entries in order to receive Neighbor Solicitations. * look up proxy NDP entries not on the routing table but on the link-level address table when receiving Neighbor Solicitations. Reviewed By: melifaro Differential Revision: https://reviews.freebsd.org/D35307 MFC after: 2 weeks
* ndp tests: fix cleanupKristof Provost2021-12-131-1/+1
| | | | | | | Fix the cleanup function name so we actually remove our test jail and interfaces. Sponsored by: Rubicon Communications, LLC ("Netgate")
* tests: Only log critical errors from scapyKristof Provost2021-05-1225-0/+50
| | | | | | | | | | | | Since 2.4.5 scapy started issuing warnings about a few different configurations during our tests. These are harmless, but they generate stderr output, which upsets atf_check. Configure scapy to only log critical errors (and thus not warnings) to fix these tests. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate")
* netinet6 tests: Fix Python warningKristof Provost2021-05-111-1/+1
| | | | | | | | | | Python 3.8 warns about line 112: 'SyntaxWarning: "is" with a literal. Did you mean "=="?' Use '==' as Python suggests. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate")
* Add arp/ndp tests in addition to rtsock ll tests.Alexander V. Chernikov2021-02-202-1/+117
|
* ping: fix some man pages and tests after r368045Alan Somers2020-11-263-10/+10
| | | | | | | MFC-with: r368045 Notes: svn path=/head/; revision=368046
* Try to enable multipath routing in flowid tests.Alexander V. Chernikov2020-10-161-1/+13
| | | | Notes: svn path=/head/; revision=366773
* Use atf_fail instead of exit 1 to indicate mpath tests failure.Alexander V. Chernikov2020-09-181-12/+6
| | | | Notes: svn path=/head/; revision=365874
* Add basic test for net.fibs dynamic growth.Alexander V. Chernikov2020-09-102-1/+94
| | | | | | | | Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D26382 Notes: svn path=/head/; revision=365609
* Fix IPv6 regression introduced by r362900.Alexander V. Chernikov2020-07-031-1/+9
| | | | | | | PR: kern/247729 Notes: svn path=/head/; revision=362909
* Temporarily skip sys.netinet6.redirect.valid_redirect in CILi-Wen Hsu2020-07-031-0/+4
| | | | | | | | PR: 247729 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=362904
* Proper check if divert(4) module is present by the relevant testsShteryana Shopova2020-05-271-1/+1
| | | | | | | | | | | Fix the netinet/netinet6 divert tests falsely reporting 'ipdivert module is not loaded' when the divert module is built into the kernel Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D25026 Notes: svn path=/head/; revision=361553
* Make sys.netinet.output and sys.netinet6.output6 tests depend on python;Edward Tomasz Napierala2020-05-191-0/+1
| | | | | | | | | | they need to be able to run net_receiver.py. MFC after: 2 weeks Sponsored by: DARPA Notes: svn path=/head/; revision=361267
* Add basic routing LPM tests.Alexander V. Chernikov2020-05-062-1/+201
| | | | | | | Differential Revision: https://reviews.freebsd.org/D24684 Notes: svn path=/head/; revision=360685
* Add tests verifying IPv4/IPv6 output for TCP/UDP/raw paths.Alexander V. Chernikov2020-03-232-1/+660
| | | | | | | | | Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24138 Notes: svn path=/head/; revision=359235
* Add basic IPv4/IPv6 forwarding tests.Alexander V. Chernikov2020-03-102-1/+484
| | | | | | | | MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24002 Notes: svn path=/head/; revision=358853
* Fix dynamic redrects by adding forgotten RTF_HOST flag.Alexander V. Chernikov2020-03-031-2/+2
| | | | | | | | | | Improve tests to verify the generated route flags. Reported by: jtl MFC after: 2 weeks Notes: svn path=/head/; revision=358585
* Temporarily skip flakey test case sys.netinet6.frag6.frag6_07.frag6_07 in CILi-Wen Hsu2020-02-161-0/+3
| | | | | | | | PR: 244170 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=358005