mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-08-18 16:00:57 +00:00
fix(fake-tcp): normalize Linux packet sockets to layer 3 (#2255)
Use AF_PACKET SOCK_DGRAM so Ethernet, TUN, and point-to-point interfaces expose the same IP payload to the BPF filter. Rebuild the synthetic Ethernet envelope expected by fake TCP on receive and strip it before transmitting through the cooked socket. Bind sockets to the selected IP protocol and reject non-initial IPv4 fragments before reading TCP ports. Preserve peer MAC addresses on Ethernet links. Add privileged TUN and veth tests for IPv4/IPv6 receive, send, tuple filtering, and fragment rejection, and enable them in Linux CI. Co-authored-by: KKRainbow <443152178@qq.com> Co-authored-by: Max Sum <4883681+Max-Sum@users.noreply.github.com>
This commit is contained in:
@@ -138,6 +138,11 @@ jobs:
|
||||
- name: Setup system for test
|
||||
run: |
|
||||
sudo modprobe br_netfilter
|
||||
sudo modprobe tun
|
||||
if [ ! -e /dev/net/tun ]; then
|
||||
sudo mkdir -p /dev/net
|
||||
sudo mknod /dev/net/tun c 10 200
|
||||
fi
|
||||
sudo sysctl net.bridge.bridge-nf-call-iptables=0
|
||||
sudo sysctl net.bridge.bridge-nf-call-ip6tables=0
|
||||
sudo sysctl net.ipv6.conf.lo.disable_ipv6=0
|
||||
@@ -153,7 +158,8 @@ jobs:
|
||||
- name: Run tests
|
||||
run: |
|
||||
sudo prlimit --pid $$ --nofile=1048576:1048576
|
||||
sudo -E env "PATH=$PATH" cargo nextest run --archive-file tests.tar.zst ${{ matrix.opts }}
|
||||
sudo -E env "PATH=$PATH" EASYTIER_LINUX_BPF_INTEGRATION=required \
|
||||
cargo nextest run --archive-file tests.tar.zst ${{ matrix.opts }}
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user