X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=test.sh;h=f13d3f9df1dbdedb525a5f1a5db586cefb44c2f6;hb=d6b7fc49f9d67897d77f2db7caa3ec6628513ffe;hp=10ae086891a5f604a1dfb20c6e7807f6ecf15216;hpb=d1468659faf993c7ccb398e3e35b8132bb208d83;p=flowspec-xdp diff --git a/test.sh b/test.sh index 10ae086..f13d3f9 100755 --- a/test.sh +++ b/test.sh @@ -228,6 +228,17 @@ echo "$TEST_PKT" >> rules.h echo "#define TEST_EXP XDP_PASS" >> rules.h clang -std=c99 -fsanitize=address -pedantic -Wall -Wextra -Wno-pointer-arith -Wno-unused-variable -O0 -g xdp.c -o xdp && ./xdp +echo "flow6 { src 2620:6e:a007:233::1/128; dst 2001:470:0:503::2/128; fragment !is_fragment || first_fragment || !last_fragment; };" | ./genrules.py --ihl=drop-options --8021q=drop-vlan --v6frag=parse-frags +echo "$TEST_PKT" >> rules.h +echo "#define TEST_EXP XDP_PASS" >> rules.h +clang -std=c99 -fsanitize=address -pedantic -Wall -Wextra -Wno-pointer-arith -Wno-unused-variable -O0 -g xdp.c -o xdp && ./xdp + +# Note on the second fragment we don't know the ICMP header (though < 256 is trivially true) +echo "flow6 { icmp type < 256; };" | ./genrules.py --ihl=drop-options --8021q=drop-vlan --v6frag=parse-frags +echo "$TEST_PKT" >> rules.h +echo "#define TEST_EXP XDP_PASS" >> rules.h +clang -std=c99 -fsanitize=address -pedantic -Wall -Wextra -Wno-pointer-arith -Wno-unused-variable -O0 -g xdp.c -o xdp && ./xdp + #TODO Is nextheader frag correct to match on here? Should we support matching on any nexthdr? echo "flow6 { next header 44; };" | ./genrules.py --ihl=accept-options --8021q=accept-vlan --v6frag=parse-frags echo "$TEST_PKT" >> rules.h