[radvd-devel-l] RemoveRDNSS option
Mark Smith
radvd at 02a76c927861ca7413a122f2a73a0d37.nosense.org
Tue Mar 22 01:36:18 EDT 2011
Hi,
Another Remove option, this time to remove RDNSS entries from
end-nodes' lists of RDNSS servers upon shutdown. Manual page text -
RemoveRDNSS on|off
Upon shutdown, announce the RDNSS entries with a zero
second lifetime. This should cause the RDNSS addresses
to be immediately removed from the end-nodes' list of
Recursive DNS Servers.
Default: on
I also performed some slight clean ups on a few of the other RDNSS
manual page entries e.g. removed some semi-colons from the ends of the
option syntax.
As before, this patch should apply to CVS revision 1.114. Patch shown below
and attached.
Regards,
Mark.
diff --git a/defaults.h b/defaults.h
index 0bf357b..f468d12 100644
--- a/defaults.h
+++ b/defaults.h
@@ -65,6 +65,7 @@
/* RDNSS */
#define DFLT_AdvRDNSSLifetime(iface) (iface)->MaxRtrAdvInterval
+#define DFLT_RemoveRDNSSFlag 1
/* DNSSL */
#define DFLT_AdvDNSSLLifetime(iface) (iface)->MaxRtrAdvInterval
diff --git a/gram.y b/gram.y
index 2d13800..f80900d 100644
--- a/gram.y
+++ b/gram.y
@@ -115,6 +115,7 @@ static struct in6_addr get_prefix6(struct in6_addr const *addr, struct in6_addr
%token T_AdvRDNSSPreference
%token T_AdvRDNSSOpenFlag
%token T_AdvRDNSSLifetime
+%token T_RemoveRDNSS
%token T_AdvDNSSLLifetime
@@ -789,6 +790,10 @@ rdnssparms : T_AdvRDNSSPreference NUMBER ';'
rdnss->AdvRDNSSLifetime = $2;
}
+ | T_RemoveRDNSS SWITCH ';'
+ {
+ rdnss->RemoveRDNSSFlag = $2;
+ }
;
dnssldef : dnsslhead '{' optional_dnsslplist '}' ';'
diff --git a/interface.c b/interface.c
index 072f548..6d3a12f 100644
--- a/interface.c
+++ b/interface.c
@@ -78,6 +78,7 @@ rdnss_init_defaults(struct AdvRDNSS *rdnss, struct Interface *iface)
rdnss->AdvRDNSSLifetime = DFLT_AdvRDNSSLifetime(iface);
rdnss->AdvRDNSSNumber = 0;
+ rdnss->RemoveRDNSSFlag = DFLT_RemoveRDNSSFlag;
}
void
diff --git a/radvd.conf.5.man b/radvd.conf.5.man
index dcc4314..075f3d8 100644
--- a/radvd.conf.5.man
+++ b/radvd.conf.5.man
@@ -498,24 +498,27 @@ Default: medium
.SH RDNSS SPECIFIC OPTIONS
.TP
-.BR "AdvRDNSSPreference " integer;
+.BR "AdvRDNSSPreference " integer
.TP
-.BR "AdvRDNSSOpen " on | off;
+.BR "AdvRDNSSOpen " on | off
These features were present in the draft specification but were removed
from RFC5006. They are still accepted in the configuration but
ignored.
.TP
-.BR "AdvRDNSSLifetime " seconds | infinity;
-The maximum duration how long the RDNSS entries are used for name resolution. A value of 0 means the nameserver should no longer be used.
-The maximum duration how long the RDNSS entries are used for name resolution. A value of 0 means the nameserver should no longer be used.
-The value, if not 0, must be at least MaxRtrAdvInterval. To ensure stale
-RDNSS info gets removed in a timely fashion, this should not be greater than
-2*MaxRtrAdvInterval.
+.BR "AdvRDNSSLifetime " seconds | infinity
+The maximum duration how long the RDNSS entries are used for name resolution. A value of 0 means the nameserver must no longer be used. The value, if not 0, must be at least MaxRtrAdvInterval. To ensure stale RDNSS info gets removed in a timely fashion, this should not be greater than 2*MaxRtrAdvInterval.
Default: 2*MaxRtrAdvInterval
+.TP
+.BR RemoveRDNSS " " on | off
+
+Upon shutdown, announce the RDNSS entries with a zero second lifetime. This should cause the RDNSS addresses to be immediately removed from the end-nodes' list of Recursive DNS Servers.
+
+Default: on
+
.SH DNSSL SPECIFIC OPTIONS
.TP
diff --git a/radvd.h b/radvd.h
index 3b8b0e5..caff5d1 100644
--- a/radvd.h
+++ b/radvd.h
@@ -135,6 +135,7 @@ struct AdvRoute {
struct AdvRDNSS {
int AdvRDNSSNumber;
uint32_t AdvRDNSSLifetime;
+ int RemoveRDNSSFlag;
struct in6_addr AdvRDNSSAddr1;
struct in6_addr AdvRDNSSAddr2;
struct in6_addr AdvRDNSSAddr3;
diff --git a/scanner.l b/scanner.l
index b6ca361..f84bfbe 100644
--- a/scanner.l
+++ b/scanner.l
@@ -89,6 +89,7 @@ AdvRouteLifetime { return T_AdvRouteLifetime; }
AdvRDNSSPreference { return T_AdvRDNSSPreference; }
AdvRDNSSOpen { return T_AdvRDNSSOpenFlag; }
AdvRDNSSLifetime { return T_AdvRDNSSLifetime; }
+RemoveRDNSS { return T_RemoveRDNSS; }
AdvDNSSLLifetime { return T_AdvDNSSLLifetime; }
diff --git a/send.c b/send.c
index cd8ef9f..1b24eef 100644
--- a/send.c
+++ b/send.c
@@ -259,7 +259,11 @@ send_ra(struct Interface *iface, struct in6_addr *dest)
rdnssinfo->nd_opt_rdnssi_len = 1 + 2*rdnss->AdvRDNSSNumber;
rdnssinfo->nd_opt_rdnssi_pref_flag_reserved = 0;
- rdnssinfo->nd_opt_rdnssi_lifetime = htonl(rdnss->AdvRDNSSLifetime);
+ if (iface->cease_adv && rdnss->RemoveRDNSSFlag) {
+ rdnssinfo->nd_opt_rdnssi_lifetime = 0;
+ } else {
+ rdnssinfo->nd_opt_rdnssi_lifetime = htonl(rdnss->AdvRDNSSLifetime);
+ }
memcpy(&rdnssinfo->nd_opt_rdnssi_addr1, &rdnss->AdvRDNSSAddr1,
sizeof(struct in6_addr));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RemoveRDNSS.patch
Type: text/x-patch
Size: 4253 bytes
Desc: not available
URL: <http://lists.litech.org/pipermail/radvd-devel-l/attachments/20110322/3ac1a6fb/attachment.bin>
More information about the radvd-devel-l
mailing list