summaryrefslogtreecommitdiffstats
path: root/src/if.h
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-05-19 16:19:05 +0100
committerRoy Marples <roy@marples.name>2020-05-19 16:19:05 +0100
commitc5445ce8235c153f4f184067ef58249f598d8629 (patch)
treeb16a5c64baf8b7e6ecfcf1f09cf38d13aa68ff09 /src/if.h
parentd2fec927e001f2430bb8d5127403968f23b9c316 (diff)
downloaddhcpcd-c5445ce8235c153f4f184067ef58249f598d8629.tar.xz
privsep: Enable Capsicum for all processes.
Except for the priviledged process. This is quite an in-depth change: * ARP is now one process per address * BPF flags are now returned via privsep * BPF write filters are locked when supported * The root process sends to the network The last step is done by opening RAW sockets and then sending a UDP header (where applicable) to avoid binding to an address which is already in use by the reader sockets. This is slightly wasteful for OS's without sandboxing but does have the very nice side effect of not needing a source address to unicast DHCPs replies from which makes the code smaller.
Diffstat (limited to 'src/if.h')
-rw-r--r--src/if.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/if.h b/src/if.h
index 73f8b915..23d94914 100644
--- a/src/if.h
+++ b/src/if.h
@@ -210,6 +210,9 @@ int if_setmac(struct interface *ifp, void *, uint8_t);
#else
# define SOCK_NONBLOCK 0x20000000
#endif
+#ifndef SOCK_CXNB
+#define SOCK_CXNB SOCK_CLOEXEC | SOCK_NONBLOCK
+#endif
int if_route(unsigned char, const struct rt *rt);
int if_initrt(struct dhcpcd_ctx *, rb_tree_t *, int);