summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2017-12-19 21:02:51 +0100
committerFrancis Dupont <fdupont@isc.org>2017-12-19 21:02:51 +0100
commita2a0f98c21c7c9926bb8901344e939e276a6242e (patch)
tree9fb85122bc47aa360a067f8782928abdbe804d35 /server
parentf1208e796d8e7208055a0afb848f7795f0ea2258 (diff)
downloadisc-dhcp-a2a0f98c21c7c9926bb8901344e939e276a6242e.tar.gz
Added local-address6
Diffstat (limited to 'server')
-rw-r--r--server/dhcpd.c23
-rw-r--r--server/dhcpd.conf.523
-rw-r--r--server/stables.c2
3 files changed, 48 insertions, 0 deletions
diff --git a/server/dhcpd.c b/server/dhcpd.c
index 68e74b54..ea62d1a0 100644
--- a/server/dhcpd.c
+++ b/server/dhcpd.c
@@ -1150,6 +1150,29 @@ void postconf_initialization (int quiet)
data_string_forget(&db, MDL);
path_dhcpd_pid = s;
}
+
+ oc = lookup_option(&server_universe, options,
+ SV_LOCAL_ADDRESS6);
+ if (oc &&
+ evaluate_option_cache(&db, NULL, NULL, NULL, options, NULL,
+ &global_scope, oc, MDL)) {
+ if (db.len == 16) {
+ memcpy(&local_address6, db.data, 16);
+ } else
+ log_fatal("invalid local address "
+ "data length");
+ data_string_forget(&db, MDL);
+ }
+
+ oc = lookup_option(&server_universe, options,
+ SV_BIND_LOCAL_ADDRESS6);
+ if (oc &&
+ evaluate_boolean_option_cache(NULL, NULL, NULL,
+ NULL, options, NULL,
+ &global_scope, oc, MDL)) {
+ bind_local_address6 = 1;
+ }
+
}
#endif /* DHCPv6 */
diff --git a/server/dhcpd.conf.5 b/server/dhcpd.conf.5
index 0973f309..1ba4009f 100644
--- a/server/dhcpd.conf.5
+++ b/server/dhcpd.conf.5
@@ -2744,6 +2744,29 @@ time.
.RE
.PP
The
+.I local-address6
+and
+.I bind-local-address6
+statements
+.RS 0.25i
+.PP
+.B local-address6 \fIaddress\fB;\fR
+.PP
+.B bind-local-address6 \fIflag\fB;\fR
+.PP
+The \fIlocal-address6\fR statement causes the DHCP server to send IPv6
+packets as originating from the specified IPv6 \fIaddress\fR, rather than
+leaving the kernel to fill in the source address field.
+.PP
+When \fIbind-local-address6\fR is present and has a value of true or on,
+service sockets are bound to \fIaddress\fR too.
+.PP
+By default \fIaddress\fR is the undefined address and the
+\fIbind-local-address6\fR is disabled, both may only be set at the global
+scope.
+.RE
+.PP
+The
.I log-facility
statement
.RS 0.25i
diff --git a/server/stables.c b/server/stables.c
index cea24bc3..f3424c92 100644
--- a/server/stables.c
+++ b/server/stables.c
@@ -288,6 +288,8 @@ static struct option server_options[] = {
{ "ddns-guard-id-must-match", "f", &server_universe, SV_DDNS_GUARD_ID_MUST_MATCH, 1 },
{ "ddns-other-guard-is-dynamic", "f", &server_universe, SV_DDNS_OTHER_GUARD_IS_DYNAMIC, 1 },
{ "release-on-roam", "f", &server_universe, SV_RELEASE_ON_ROAM, 1 },
+ { "local-address6", "6", &server_universe, SV_LOCAL_ADDRESS6, 1 },
+ { "bind-local-address6", "f", &server_universe, SV_BIND_LOCAL_ADDRESS6, 1 },
{ NULL, NULL, NULL, 0, 0 }
};