-/* $OpenBSD: frontend.c,v 1.9 2024/06/04 15:48:47 florian Exp $ */
+/* $OpenBSD: frontend.c,v 1.10 2024/06/05 10:25:07 florian Exp $ */
/*
* Copyright (c) 2017, 2021, 2024 Florian Obser <florian@openbsd.org>
case DHCPRENEW:
case DHCPREBIND:
pd = &iface->pds[ia_conf->id];
- iaprefix.prefix_len = pd->prefix_len;
- memcpy(&iaprefix.prefix, &pd->prefix,
- sizeof(struct in6_addr));
+ if (pd->prefix_len > 0) {
+ iaprefix.prefix_len = pd->prefix_len;
+ memcpy(&iaprefix.prefix, &pd->prefix,
+ sizeof(struct in6_addr));
+ } else
+ iaprefix.prefix_len = ia_conf->prefix_len;
break;
default:
fatalx("%s: %s not implemented", __func__,