Add a Learning VLAN program example
* Create a simulation of a physical network with multiple vlans, which
can accept and distribute connections from multiple clients in
overlapping subnets. The program will assign to a worker based on mac
address.
* Remove a hardcoded SO_ATTACH_BPF literal, and fix one spacing
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
diff --git a/src/cc/libbpf.c b/src/cc/libbpf.c
index 905b9e2..53b944d 100644
--- a/src/cc/libbpf.c
+++ b/src/cc/libbpf.c
@@ -148,7 +148,7 @@
}
int bpf_attach_socket(int sock, int prog) {
- return setsockopt(sock, SOL_SOCKET, 50 /*SO_ATTACH_BPF*/, &prog, sizeof(prog));
+ return setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, &prog, sizeof(prog));
}
static int bpf_attach_tracing_event(int progfd, const char *event_path, pid_t pid, int cpu, int group_fd)