<br><br><div class="gmail_quote">On Sun, Mar 20, 2011 at 11:17 PM, Mark Smith <span dir="ltr"><<a href="mailto:radvd@02a76c927861ca7413a122f2a73a0d37.nosense.org">radvd@02a76c927861ca7413a122f2a73a0d37.nosense.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br>
<br>
Following up from the DeprecatePrefix option, here is the equivalent<br>
for Route Information Options. Here's the manual page text -<br>
<br>
RemoveRoute on|off<br>
<br>
Upon shutdown, announce this route with a zero second<br>
lifetime. This should cause the route to be immediately<br>
removed from the receiving end-nodes' route table.<br>
<br>
Default: on<br>
<br>
<br>
It defaults to on as RFC4191 says the following in "4. Router<br>
Configuration" -<br>
<br>
"<br>
When ceasing to be an advertising<br>
interface and sending Router Advertisements with a Router Lifetime of<br>
zero, the Router Advertisement SHOULD also set the Route Lifetime to<br>
zero in all Route Information Options"<br>
<br>
<br>
Patch against CVS revision 1.114. Attached as a file and shown below.<br>
<br>
Regards,<br>
Mark.<br>
<br>
diff --git a/defaults.h b/defaults.h<br>
index 0bf357b..d6fcdfe 100644<br>
--- a/defaults.h<br>
+++ b/defaults.h<br>
@@ -62,6 +62,7 @@<br>
#define DFLT_AdvRouteLifetime(iface) (3 * (iface)->MaxRtrAdvInterval)<br>
<br>
#define DFLT_AdvRoutePreference 0 /* medium*/<br>
+#define DFLT_RemoveRouteFlag 1<br>
<br>
/* RDNSS */<br>
#define DFLT_AdvRDNSSLifetime(iface) (iface)->MaxRtrAdvInterval<br>
diff --git a/gram.y b/gram.y<br>
index 2d13800..13a8887 100644<br>
--- a/gram.y<br>
+++ b/gram.y<br>
@@ -111,6 +111,7 @@ static struct in6_addr get_prefix6(struct in6_addr const *addr, struct in6_addr<br>
<br>
%token T_AdvRoutePreference<br>
%token T_AdvRouteLifetime<br>
+%token T_RemoveRoute<br>
<br>
%token T_AdvRDNSSPreference<br>
%token T_AdvRDNSSOpenFlag<br>
@@ -704,6 +705,10 @@ routeparms : T_AdvRoutePreference SIGNEDNUMBER ';'<br>
{<br>
route->AdvRouteLifetime = $2;<br>
}<br>
+ | T_RemoveRoute SWITCH ';'<br>
+ {<br>
+ route->RemoveRouteFlag = $2;<br>
+ }<br>
;<br>
<br>
rdnssdef : rdnsshead '{' optional_rdnssplist '}' ';'<br>
diff --git a/interface.c b/interface.c<br>
index 072f548..d7c0258 100644<br>
--- a/interface.c<br>
+++ b/interface.c<br>
@@ -69,6 +69,7 @@ route_init_defaults(struct AdvRoute *route, struct Interface *iface)<br>
<br>
route->AdvRouteLifetime = DFLT_AdvRouteLifetime(iface);<br>
route->AdvRoutePreference = DFLT_AdvRoutePreference;<br>
+ route->RemoveRouteFlag = DFLT_RemoveRouteFlag;<br>
}<br>
<br>
void<br>
diff --git a/radvd.conf.5.man b/radvd.conf.5.man<br>
index dcc4314..acd26ae 100644<br>
--- a/radvd.conf.5.man<br>
+++ b/radvd.conf.5.man<br>
@@ -495,6 +495,13 @@ The preference associated with the default router, as either "low",<br>
<br>
Default: medium<br>
<br>
+.TP<br>
+.BR RemoveRoute " " on | off<br>
+<br>
+Upon shutdown, announce this route with a zero second lifetime. This should cause the route to be immediately removed from the receiving end-nodes' route table.<br>
+<br>
+Default: on<br>
+<br>
.SH RDNSS SPECIFIC OPTIONS<br>
<br>
.TP<br>
diff --git a/radvd.h b/radvd.h<br>
index 3b8b0e5..cdd679f 100644<br>
--- a/radvd.h<br>
+++ b/radvd.h<br>
@@ -126,6 +126,7 @@ struct AdvRoute {<br>
<br>
int AdvRoutePreference;<br>
uint32_t AdvRouteLifetime;<br>
+ int RemoveRouteFlag;<br>
<br>
struct AdvRoute *next;<br>
};<br>
diff --git a/scanner.l b/scanner.l<br>
index b6ca361..01ea6d8 100644<br>
--- a/scanner.l<br>
+++ b/scanner.l<br>
@@ -85,6 +85,7 @@ HomeAgentLifetime { return T_HomeAgentLifetime; }<br>
<br>
AdvRoutePreference { return T_AdvRoutePreference; }<br>
AdvRouteLifetime { return T_AdvRouteLifetime; }<br>
+RemoveRoute { return T_RemoveRoute; }<br>
<br>
AdvRDNSSPreference { return T_AdvRDNSSPreference; }<br>
AdvRDNSSOpen { return T_AdvRDNSSOpenFlag; }<br>
diff --git a/send.c b/send.c<br>
index cd8ef9f..46a9c92 100644<br>
--- a/send.c<br>
+++ b/send.c<br>
@@ -234,7 +234,11 @@ send_ra(struct Interface *iface, struct in6_addr *dest)<br>
<br>
rinfo->nd_opt_ri_flags_reserved =<br>
(route->AdvRoutePreference << ND_OPT_RI_PRF_SHIFT) & ND_OPT_RI_PRF_MASK;<br>
- rinfo->nd_opt_ri_lifetime = htonl(route->AdvRouteLifetime);<br>
+ if (iface->cease_adv && route->RemoveRouteFlag) {<br>
+ rinfo->nd_opt_ri_lifetime = 0;<br>
+ } else {<br>
+ rinfo->nd_opt_ri_lifetime = htonl(route->AdvRouteLifetime);<br>
+ }<br>
<br>
memcpy(&rinfo->nd_opt_ri_prefix, &route->Prefix,<br>
sizeof(struct in6_addr));<br>
<br>--<br>
radvd-devel-l mailing list : <a href="mailto:radvd-devel-l@litech.org">radvd-devel-l@litech.org</a><br>
<a href="http://lists.litech.org/listinfo/radvd-devel-l" target="_blank">http://lists.litech.org/listinfo/radvd-devel-l</a><br></blockquote></div><br><br>Hi Mark,<br><br>Glancing over it in my email, it looks good. For some reason, my gmail is showing the patch inline. Can you send it again as a .patch file? The last .patch file came in fine in gmail.<br>
<br>Thanks,<br>Reuben<br>