blob: a263ef9232bdc193cff7672b71520db9aa2c8b54 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
From: Roger Shimizu <rosh@debian.org>
Date: Sun, 6 Sep 2020 14:34:36 +0900
Subject: Make sla-len config optional
Cherry-pick from Fedora:
https://src.fedoraproject.org/rpms/wide-dhcpv6/blob/master/f/wide-dhcpv6-0008-Make-sla-len-config-optional.patch
---
prefixconf.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/prefixconf.c b/prefixconf.c
index 15b5417..98d9b77 100644
--- a/prefixconf.c
+++ b/prefixconf.c
@@ -460,6 +460,17 @@ add_ifprefix(siteprefix, prefix, pconf)
ifpfx->paddr.sin6_len = sizeof(struct sockaddr_in6);
#endif
ifpfx->paddr.sin6_addr = prefix->addr;
+
+ /*
+ * dave (bevhost) thinks this should fix it rather than
+ * generare the error below "invalid prefix length"
+ * this way the sla-len can be left out of the config file
+ * and calculated when the prefix is received
+ */
+ if (prefix->plen + pconf->ifid_len + pconf->sla_len > 128) {
+ pconf->sla_len = 128 - pconf->ifid_len - prefix->plen;
+ }
+
ifpfx->plen = prefix->plen + pconf->sla_len;
/*
* XXX: our current implementation assumes ifid len is a multiple of 8
|