From 4aa8e54a303dfde9a53c47cd07c5af3c5fad4f01 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Tue, 13 Apr 2021 21:59:47 +0200 Subject: passt: Introduce a DHCPv6 server This implementation, similarly to the IPv4 DHCP one, hands out a single address, which is the same as the upstream address for the host. This avoids the need for address translation as long as the client runs a DHCPv6 client. The NDP "Managed" flag is now set in Router Advertisements. Signed-off-by: Stefano Brivio --- ndp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ndp.c') diff --git a/ndp.c b/ndp.c index 7468134..1e0d817 100644 --- a/ndp.c +++ b/ndp.c @@ -80,13 +80,14 @@ int ndp(struct ctx *c, struct ethhdr *eh, size_t len) ihr->icmp6_type = RA; ihr->icmp6_code = 0; ihr->icmp6_rt_lifetime = htons(3600); + ihr->icmp6_addrconf_managed = 1; p = (unsigned char *)(ihr + 1); p += 8; /* reachable, retrans time */ *p++ = 3; /* prefix */ *p++ = 4; /* length */ *p++ = 64; /* prefix length */ - *p++ = 0xc0; /* flags: L, A */ + *p++ = 0xc0; /* prefix flags: L, A */ *(uint32_t *)p = htonl(3600); /* lifetime */ p += 4; *(uint32_t *)p = htonl(3600); /* preferred lifetime */ -- cgit v1.2.3