NetworkManager/shared/n-acd/src/test-veth.c

241 lines
10 KiB
C
Raw Normal View History

Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
/*
* Test on a veth link
*
* This essentially mimics a real network with two peers.
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
*
* Run one ACD context on each end of the tunnel. On one end probe for N,
* addresses on the other end pre-configure N/3 of the same addresses and probe
* for another N/3 of the addresses.
*
* Verify that in the case of simultaneous probes of the same address at most one
* succeed, in the case of probing for a configured address it always fails, and
* probing for a non-existent address always succeeds.
*
* Make sure to keep N fairly high as the protocol is probabilistic, and we also
* want to verify that resizing the internal maps works correctly.
*/
#undef NDEBUG
#include <c-stdaux.h>
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
#include <stdlib.h>
#include "test.h"
#define TEST_ACD_N_PROBES (9)
typedef enum {
TEST_ACD_STATE_UNKNOWN,
TEST_ACD_STATE_USED,
TEST_ACD_STATE_READY,
} TestAcdState;
static void test_veth(int ifindex1, uint8_t *mac1, size_t n_mac1,
int ifindex2, uint8_t *mac2, size_t n_mac2) {
NAcdConfig *config;
NAcd *acd1, *acd2;
NAcdProbe *probes1[TEST_ACD_N_PROBES];
NAcdProbe *probes2[TEST_ACD_N_PROBES];
unsigned long state1, state2;
size_t n_running = 0;
int r;
r = n_acd_config_new(&config);
c_assert(!r);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
n_acd_config_set_transport(config, N_ACD_TRANSPORT_ETHERNET);
n_acd_config_set_ifindex(config, ifindex1);
n_acd_config_set_mac(config, mac1, n_mac1);
r = n_acd_new(&acd1, config);
c_assert(!r);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
n_acd_config_set_ifindex(config, ifindex2);
n_acd_config_set_mac(config, mac2, n_mac2);
r = n_acd_new(&acd2, config);
c_assert(!r);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
n_acd_config_free(config);
{
NAcdProbeConfig *probe_config;
r = n_acd_probe_config_new(&probe_config);
c_assert(!r);
n_acd_probe_config_set_timeout(probe_config, 1024);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
c_assert(TEST_ACD_N_PROBES <= 10 << 24);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
for (size_t i = 0; i < TEST_ACD_N_PROBES; ++i) {
struct in_addr ip = { htobe32((10 << 24) | i) };
n_acd_probe_config_set_ip(probe_config, ip);
switch (i % 3) {
case 0:
/*
* Probe on one side, and leave the address
* unset on the other. The probe must succeed.
*/
break;
case 1:
/*
* Preconfigure the address on one side, and
* probe on the other. The probe must fail.
*/
test_add_child_ip(&ip);
break;
case 2:
/*
* Probe both sides for the same address, at
* most one may succeed.
*/
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
r = n_acd_probe(acd2, &probes2[i], probe_config);
c_assert(!r);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
++n_running;
break;
default:
c_assert(0);
abort();
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
break;
}
r = n_acd_probe(acd1, &probes1[i], probe_config);
c_assert(!r);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
++n_running;
}
n_acd_probe_config_free(probe_config);
while (n_running > 0) {
NAcdEvent *event;
struct pollfd pfds[2] = {
{ .events = POLLIN },
{ .events = POLLIN },
};
n_acd_get_fd(acd1, &pfds[0].fd);
n_acd_get_fd(acd2, &pfds[1].fd);
r = poll(pfds, 2, -1);
c_assert(r >= 0);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
if (pfds[0].revents & POLLIN) {
r = n_acd_dispatch(acd1);
c_assert(!r || r == N_ACD_E_PREEMPTED);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
for (;;) {
r = n_acd_pop_event(acd1, &event);
c_assert(!r);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
if (event) {
switch (event->event) {
case N_ACD_EVENT_READY:
n_acd_probe_get_userdata(event->ready.probe, (void**)&state1);
c_assert(state1 == TEST_ACD_STATE_UNKNOWN);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
state1 = TEST_ACD_STATE_READY;
n_acd_probe_set_userdata(event->ready.probe, (void*)state1);
break;
case N_ACD_EVENT_USED:
n_acd_probe_get_userdata(event->used.probe, (void**)&state1);
c_assert(state1 == TEST_ACD_STATE_UNKNOWN);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
state1 = TEST_ACD_STATE_USED;
n_acd_probe_set_userdata(event->used.probe, (void*)state1);
break;
default:
c_assert(0);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
}
--n_running;
} else {
break;
}
}
}
if (pfds[1].revents & POLLIN) {
r = n_acd_dispatch(acd2);
c_assert(!r || r == N_ACD_E_PREEMPTED);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
for (;;) {
r = n_acd_pop_event(acd2, &event);
c_assert(!r);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
if (event) {
switch (event->event) {
case N_ACD_EVENT_READY:
n_acd_probe_get_userdata(event->ready.probe, (void**)&state2);
c_assert(state2 == TEST_ACD_STATE_UNKNOWN);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
state2 = TEST_ACD_STATE_READY;
n_acd_probe_set_userdata(event->ready.probe, (void*)state2);
break;
case N_ACD_EVENT_USED:
n_acd_probe_get_userdata(event->used.probe, (void**)&state2);
c_assert(state2 == TEST_ACD_STATE_UNKNOWN);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
state2 = TEST_ACD_STATE_USED;
n_acd_probe_set_userdata(event->used.probe, (void*)state2);
break;
default:
c_assert(0);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
}
--n_running;
} else {
break;
}
}
}
}
for (size_t i = 0; i < TEST_ACD_N_PROBES; ++i) {
struct in_addr ip = { htobe32((10 << 24) | i) };
switch (i % 3) {
case 0:
n_acd_probe_get_userdata(probes1[i], (void **)&state1);
c_assert(state1 == TEST_ACD_STATE_READY);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
break;
case 1:
test_del_child_ip(&ip);
n_acd_probe_get_userdata(probes1[i], (void **)&state1);
c_assert(state1 == TEST_ACD_STATE_USED);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
break;
case 2:
n_acd_probe_get_userdata(probes1[i], (void **)&state1);
n_acd_probe_get_userdata(probes2[i], (void **)&state2);
c_assert(state1 != TEST_ACD_STATE_UNKNOWN);
c_assert(state2 != TEST_ACD_STATE_UNKNOWN);
c_assert(state1 == TEST_ACD_STATE_USED || state2 == TEST_ACD_STATE_USED);
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
n_acd_probe_free(probes2[i]);
break;
}
n_acd_probe_free(probes1[i]);
}
}
n_acd_unref(acd2);
n_acd_unref(acd1);
}
int main(int argc, char **argv) {
struct ether_addr mac1, mac2;
int ifindex1, ifindex2;
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
test_setup();
Squashed 'shared/n-acd/' changes from a68b55992..a40949267 a40949267 build: add CI run without ebpf 044db2056 n-acd: drop redundant headers 6a391cd83 n-acd: fix build without eBPF bb194cf09 n-acd/config: make transport mandatory ec2865743 build: drop unused c-sundry 721d9d84f n-acd: inline c_container_of() 1a7ee317c util/timer: fix coding-style 6c96f926b util/timer: fall back to CLOCK_MONOTONIC if necessary 4ea3165fc n-acd: only use CLOCK_BOOTTIME if really necessary c1b853c6c util/timer: cleanup headers b1d6ad272 n-acd: add destructors that return void 185be55b6 test-bpf: skip test in case of unsufficient privs 84a40e8fa build: add NEWS file bf11443ff build: mention mailinglist in readme e2797984a test-bpf: drop bpf-filter.h 668ed3c82 subprojects: pull in updates dd8cab3f0 test-veth: reduce parallel execution to 9 68b09ba2b build: update AUTHORS 3f77e3e88 test: make function headers valid C 5275a5120 test: get rid of spurious tab 037df412c n-acd: make struct initializers valid C 346ec0c67 build: upgrade CI 38682a36d n-acd: fix signed vs unsigned comparison 5e7578b33 bpf: properly zero out trailing bpf_attr space ee1e432ae probe: fix coding-style a143540f9 build: use lower-case build options 835533e7d build: minor style fixes 2bd6d1d29 build: get rid of tabs b14979934 eBPF: make compile-time optional 6f13c27ee n-acd: filter out invalid packets 4e6a169a0 build: sync with c-util repositories 6c4a9117b build: document eBPF kernel requirement 3ef08394d n-acd: don't remember dropped defense attempts 4dff8771f n-acd: fix coding-style b11fb9706 n-acd/config: default to the RFC-specified timeout d885bb3b7 n-acd/event: don't expose the type of operation that caused a conflict e2f87e047 TODO: drop remaining items f06993856 test/veth: reduce the number of probed addresses 8b4f7ed64 test/veth: bump the timeout a bit 14e4606f6 n-acd/probe: don't cap the jitter at 4s a0247b86f test/veth: fix stackvariable corruption a64ac8389 n-acd/probe: update comments aa9c25bc1 n-acd/handle_timeout: update comments b6c2df3a9 timer: rename timer_pop() to timer_pop_timeout() 47c657a8d test: fix handling of child addresses 27168ba9e timer: move timer_read() from n-acd.c to util/timer.c 21a1e37aa timer: require timer to be explicitly rearmed ee1080820 bpf/map: make key/value sizes self-documenting fd444353e test/veth: rework test ba2bc433c test: rework child_ip() helper 07881b8da test: silence a warning 38da00b0a test/bpf: make tests for map modifications more comprehensive 6a2ffd23a test/timerfd: for documentation purposes verify the kernel API 01a9cf54b probe: move from ms to ns internally 4fe438dd9 n-acd: move to use the Timer utility library e098cfc79 util: add a timer utility helper 8ea196e5b subprojects: pull in c-sundry 0c0b3c29f acd/probe: do not subscribe to packets in FAILED state 9c922ea3d acd/probe: introduce probe_{un,}link() helpers 024a830e6 acd/probe: use unschedule() helper in free() b098a3bcc tests/veth: minor fixes to the test fe3d9578a acd/packet: consider unexpected packets a fatal error 34d7656d7 acd: stop state-machine after USED or CONFLICT events 7d9e5ec6b acd: don't declare iovec entries inline 7afd8d8a3 tests: add veth test 26a737b42 tests/veth: add helper for adding IP addresses to child device e73a37a11 probe: store a userdata pointer in the probe object 327e82625 test: introduce loopback helper 0682b15f8 acd: reduce default map size afead881f tests: reinstate loopback test 4527d2f71 BPF: move and document the eBPF helpers 88bacc022 socket filter: move to the new eBPF helpers 245104d5c tests: skip tests if lacking permissions 195d9ff5a n-acd: rework API to support many probes on a context ab440eb99 eBPF: never return packets that userspace should unconditionally drop ac933f412 eBPF: add eBPF helper functions git-subtree-dir: shared/n-acd git-subtree-split: a40949267923c45cb232fa4c1d60eafacee4b36e
2018-09-18 15:14:49 +02:00
test_veth_new(&ifindex1, &mac1, &ifindex2, &mac2);
for (unsigned int i = 0; i < 8; ++i) {
test_veth(ifindex1, mac1.ether_addr_octet, sizeof(mac1.ether_addr_octet),
ifindex2, mac2.ether_addr_octet, sizeof(mac2.ether_addr_octet));
}
return 0;
}