diff options
author | Kristóf Marussy <kris7topher@gmail.com> | 2019-12-30 20:56:03 +0100 |
---|---|---|
committer | Kristóf Marussy <kris7topher@gmail.com> | 2020-01-01 03:40:19 +0100 |
commit | c082d90be6396149404704e127f10ec7c9aa79ad (patch) | |
tree | 2301e5c31f352d7d1465dcb7d268cb3c55e4a879 /src/fnet/fnet.h | |
parent | Run dhclient inside the sandbox (diff) | |
download | firejail-c082d90be6396149404704e127f10ec7c9aa79ad.tar.gz firejail-c082d90be6396149404704e127f10ec7c9aa79ad.tar.zst firejail-c082d90be6396149404704e127f10ec7c9aa79ad.zip |
Wait for link-local address for DHCPv6
dhclient -6 fails if the interface to be configures has no link-local address.
This is especially problematic when only DHCPv6 is used
(e.g., --ip=none --ip6=dhcp), because the wait for a DHCPv4 lease is usually
ample time for the LL address to become available on the IPv6 link.
The LL address must not be tenative.
Therefore, this patch implements waiting for a non-tentative link-local
address in fnet for DHCPv6 configured interfaces.
The command fnet waitll <if> waits for an LL address on the interface <if>.
Currently, the maximum waiting time is 30 seconds,
and the kernel is polled through rtnetlink every 500 milliseconds.
These values seem sufficient for virtual bridged networks,
e.g., libvirt NAT networks.
Diffstat (limited to 'src/fnet/fnet.h')
-rw-r--r-- | src/fnet/fnet.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/fnet/fnet.h b/src/fnet/fnet.h index 4900967f7..4d0d62b39 100644 --- a/src/fnet/fnet.h +++ b/src/fnet/fnet.h | |||
@@ -47,6 +47,7 @@ int net_get_mac(const char *ifname, unsigned char mac[6]); | |||
47 | void net_if_ip(const char *ifname, uint32_t ip, uint32_t mask, int mtu); | 47 | void net_if_ip(const char *ifname, uint32_t ip, uint32_t mask, int mtu); |
48 | int net_if_mac(const char *ifname, const unsigned char mac[6]); | 48 | int net_if_mac(const char *ifname, const unsigned char mac[6]); |
49 | void net_if_ip6(const char *ifname, const char *addr6); | 49 | void net_if_ip6(const char *ifname, const char *addr6); |
50 | void net_if_waitll(const char *ifname); | ||
50 | 51 | ||
51 | 52 | ||
52 | // arp.c | 53 | // arp.c |