[radvd-devel-l] FlushRDNSS option - renamed from RemoveRDNSS

Mark Smith radvd at 02a76c927861ca7413a122f2a73a0d37.nosense.org
Fri Mar 25 01:28:31 EDT 2011


Hi,

Following from the discussion with Pekka a few days ago, I've renamed
the RemoveRDNSS option to "FlushRDNSS". There are no other changes.

Patch attached and shown below, should apply to cvs revision 1.115.

Thanks,
Mark.

diff --git a/defaults.h b/defaults.h
index 0bf357b..ddb6e43 100644
--- a/defaults.h
+++ b/defaults.h
@@ -65,6 +65,7 @@
 
 /* RDNSS */
 #define DFLT_AdvRDNSSLifetime(iface)			(iface)->MaxRtrAdvInterval
+#define DFLT_FlushRDNSSFlag		1
 
 /* DNSSL */
 #define DFLT_AdvDNSSLLifetime(iface)			(iface)->MaxRtrAdvInterval
diff --git a/gram.y b/gram.y
index 2d13800..232e895 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_FlushRDNSS
 
 %token		T_AdvDNSSLLifetime
 
@@ -789,6 +790,10 @@ rdnssparms	: T_AdvRDNSSPreference NUMBER ';'
 
 			rdnss->AdvRDNSSLifetime = $2;
 		}
+		| T_FlushRDNSS SWITCH ';'
+		{
+			rdnss->FlushRDNSSFlag = $2;
+		}
 		;
 
 dnssldef	: dnsslhead '{' optional_dnsslplist '}' ';'
diff --git a/interface.c b/interface.c
index 072f548..b857008 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->FlushRDNSSFlag = DFLT_FlushRDNSSFlag;
 }
 
 void
diff --git a/radvd.conf.5.man b/radvd.conf.5.man
index dcc4314..f58ff4d 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 FlushRDNSS " " 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..b7d30a1 100644
--- a/radvd.h
+++ b/radvd.h
@@ -135,6 +135,7 @@ struct AdvRoute {
 struct AdvRDNSS {
 	int 			AdvRDNSSNumber;
 	uint32_t		AdvRDNSSLifetime;
+	int			FlushRDNSSFlag;
 	struct in6_addr		AdvRDNSSAddr1;
 	struct in6_addr		AdvRDNSSAddr2;
 	struct in6_addr		AdvRDNSSAddr3;
diff --git a/scanner.l b/scanner.l
index b6ca361..86579f2 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; }
+FlushRDNSS		{ return T_FlushRDNSS; }
 
 AdvDNSSLLifetime	{ return T_AdvDNSSLLifetime; }
 
diff --git a/send.c b/send.c
index cd8ef9f..a717226 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->FlushRDNSSFlag) {
+			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: FlushRDNSS.patch
Type: text/x-patch
Size: 4242 bytes
Desc: not available
URL: <http://lists.litech.org/pipermail/radvd-devel-l/attachments/20110325/62665fbd/attachment-0001.bin>


More information about the radvd-devel-l mailing list