aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tests/netns.sh (follow)
Commit message (Collapse)AuthorAgeFilesLines
* allowedips: initialize list head when removing intermediate nodesJason A. Donenfeld2019-04-061-0/+4
| | | | | | | | | | Otherwise if this list item is later reused, we'll crash on list poison or worse. Also, add a version of Mimka's reproducer to netns.sh to catch these types of bugs in the future. Reported-by: Mimka <mikma.wg@lists.m7n.se>
* noise: store clamped key instead of raw keyJason A. Donenfeld2019-02-031-0/+2
|
* netlink: use __kernel_timespec for handshake timeJason A. Donenfeld2019-01-231-1/+3
|
* global: update copyrightJason A. Donenfeld2019-01-071-1/+1
|
* netns: nmap != ncatJason A. Donenfeld2018-12-181-4/+4
|
* global: satisfy check_patch.pl errorsJason A. Donenfeld2018-09-031-1/+1
|
* netlink: don't start over iteration on multipart non-first allowedipsJason A. Donenfeld2018-08-091-0/+24
| | | | Reported-by: Matt Layher <mdlayher@gmail.com>
* send: account for route-based MTUJason A. Donenfeld2018-04-151-0/+13
| | | | | | | | | | It might be that a particular route has a different MTU than the interface, via `ip route add ... dev wg0 mtu 1281`, for example. In this case, it's important that we don't accidently pad beyond the end of the MTU. We accomplish that in this patch by carrying forward the MTU from the dst if it exists. We also add a unit test for this issue. Reported-by: Roman Mamedov <rm.wg@romanrm.net>
* netns: replace n0 ip with ip0, per customJason A. Donenfeld2018-02-121-2/+2
|
* global: year bumpJason A. Donenfeld2018-01-031-1/+1
|
* global: add SPDX tags to all filesGreg Kroah-Hartman2017-12-091-2/+3
| | | | | | | | | | | | | It's good to have SPDX identifiers in all files as the Linux kernel developers are working to add these identifiers to all files. Update all files with the correct SPDX license identifier based on the license text of the project or based on the license in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Modified-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tools: fix removing preshared keysJason A. Donenfeld2017-11-231-0/+18
| | | | Also clean up related logic quite a bit and add unit tests.
* netlink: make sure we reserve space for NLMSG_DONEJason A. Donenfeld2017-11-101-0/+9
| | | | | | | Otherwise, if messages pack really close together, we'll exceed the size of the sk_buff and return ENOBUFS. I suspect this has been the cause of a lot of weird bugs that people just worked around by increasing the receive buffer size. This actually addresses the root cause.
* stats: more robust accountingJason A. Donenfeld2017-10-311-1/+8
|
* netns: use time-based test instead of quantity-basedJason A. Donenfeld2017-10-311-4/+4
|
* netns: use read built-in instead of ncat hack for dmesgJason A. Donenfeld2017-10-311-4/+2
| | | | | | | | | | This misses lines that are greater than 128 bytes -- read returns -EINVAL -- but the lines we care about anyway are less than that, so we simply keep looping and skip the bad reads when this happens. Not ideal, but probably the best we can do in pure bash. And, importantly, it's much better than streaming this over a TCP socket, which was an even uglier hack.
* netns: disable accept_dad for all interfacesJason A. Donenfeld2017-10-171-0/+2
| | | | | Upstream's a2d3f3e33853ef52e5f66b41c3e8ee5710aa3305 broke things in strange and confusing ways.
* routingtable: iterate progressivelyJason A. Donenfeld2017-10-091-2/+2
|
* send: put keypair referenceJason A. Donenfeld2017-10-051-0/+19
|
* netlink: switch from ioctl to netlink for configurationJason A. Donenfeld2017-10-021-1/+38
|
* netns: disable rp_filter for final testJason A. Donenfeld2017-09-241-0/+4
|
* socket: improve reply-to-src algorithmJason A. Donenfeld2017-08-231-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We store the destination IP of incoming packets as the source IP of outgoing packets. When we send outgoing packets, we then ask the routing table for which interface to use and which source address, given our inputs of the destination address and a suggested source address. This all is good and fine, since it means we'll successfully reply using the correct source address, correlating with the destination address for incoming packets. However, what happens when default routes change? Or when interface IP addresses change? Prior to this commit, after getting the response from the routing table of the source address, destination address, and interface, we would then make sure that the source address actually belonged to the outbound interface. If it didn't, we'd reset our source address to zero and re-ask the routing table, in which case the routing table would then give us the default IP address for sending that packet. This worked mostly fine for most purposes, but there was a problem: what if WireGuard legitimately accepted an inbound packet on a default interface using an IP of another interface? In this case, falling back to asking for the default source IP was not a good strategy, since it'd nearly always mean we'd fail to reply using the right source. So, this commit changes the algorithm slightly. Rather than falling back to using the default IP if the preferred source IP doesn't belong to the outbound interface, we have two checks: we make sure that the source IP address belongs to _some_ interface on the system, no matter which one (so long as it's within the network namespace), and we check whether or not the interface of an incoming packet matches the returned interface for the outbound traffic. If both these conditions are true, then we proceed with using this source IP address. If not, we fall back to the default IP address.
* netns: work around linux 3.10 issuesJason A. Donenfeld2017-08-031-0/+6
|
* netns: explictly test reply to sender routingJason A. Donenfeld2017-08-031-1/+25
|
* global: wireguard.io --> wireguard.comJason A. Donenfeld2017-07-201-1/+1
| | | | | Due to concerns with the .io TLD, we are switching to using wireguard.com instead.
* receive: trim incoming packets to IP header lengthJason A. Donenfeld2017-06-011-1/+1
|
* tests: check for stats counter increasesJason A. Donenfeld2017-05-171-0/+4
| | | | | The kernel API for this has changed a lot, so this test is important to ensure our compat layer is doing the right thing.
* noise: redesign preshared key modeJason A. Donenfeld2017-05-171-2/+2
|
* netns: cleanup and add diagramJason A. Donenfeld2017-04-141-7/+18
|
* Update copyrightJason A. Donenfeld2017-01-101-1/+1
|
* compat: support 3.18, 3.19, 4.0Jason A. Donenfeld2016-12-261-1/+1
|
* tests: avoid non-strict writes via printfJason A. Donenfeld2016-12-161-11/+8
|
* tests: directly kill nmapJason A. Donenfeld2016-12-041-7/+12
|
* tests: make sure ncat gets killedJason A. Donenfeld2016-12-041-3/+4
|
* tests: be sure we get all messagesJason A. Donenfeld2016-11-291-1/+6
|
* tests: veth does not come up immediatelyJason A. Donenfeld2016-11-211-0/+7
|
* headers: cleanup noticesJason A. Donenfeld2016-11-211-0/+2
|
* tests: trim outputJason A. Donenfeld2016-11-151-20/+4
|
* tests: use private ipv6 addressesJason A. Donenfeld2016-11-151-18/+18
|
* socket: ensure that saddr routing can deal with interface removalJason A. Donenfeld2016-11-151-0/+32
|
* netns: remove dangling $@Jason A. Donenfeld2016-08-291-4/+4
|
* tests: test jumbo frames with more transferJason A. Donenfeld2016-08-211-4/+19
|
* tests: add crypto-RP filter testJason A. Donenfeld2016-08-121-0/+18
|
* tests: use makefile and expand greatlyJason A. Donenfeld2016-08-081-89/+163
|
* tests: improve test suite and add qemu testerJason A. Donenfeld2016-07-181-0/+142