Add comments about the choice of default route in a two (or more) IPv6 prefixes link.
1.1 --- a/examples/radvd-two-prefix.cc Tue Sep 08 06:37:37 2009 +0200
1.2 +++ b/examples/radvd-two-prefix.cc Tue Sep 08 07:07:58 2009 +0200
1.3 @@ -159,8 +159,8 @@
1.4 iic2.Add (iicr2);
1.5
1.6 /* radvd configuration */
1.7 - Ipv6Address prefix ("2001:1::0"); /* create the prefix */
1.8 - Ipv6Address prefixBis ("2001:ABCD::0"); /* create the prefix */
1.9 + Ipv6Address prefix ("2001:ABCD::0"); /* create the prefix */
1.10 + Ipv6Address prefixBis ("2001:1::0"); /* create the prefix */
1.11 Ipv6Address prefix2 ("2001:2::0"); /* create the prefix */
1.12 uint32_t indexRouter = iic1.GetInterfaceIndex (1); /* R interface (n0 - R) */
1.13 uint32_t indexRouter2 = iic2.GetInterfaceIndex (1); /* R interface (R - n1) */
2.1 --- a/src/routing/static-routing/ipv6-static-routing.cc Tue Sep 08 06:37:37 2009 +0200
2.2 +++ b/src/routing/static-routing/ipv6-static-routing.cc Tue Sep 08 07:07:58 2009 +0200
2.3 @@ -274,7 +274,6 @@
2.4 uint32_t interfaceIdx = route->GetInterface ();
2.5 rtentry = Create<Ipv6Route> ();
2.6
2.7 -
2.8 if (route->GetGateway ().IsAny ())
2.9 {
2.10 rtentry->SetSource (SourceAddressSelection (interfaceIdx, route->GetDest ()));
2.11 @@ -295,7 +294,10 @@
2.12 }
2.13 }
2.14
2.15 - NS_LOG_LOGIC ("Matching route via " << rtentry->GetDestination () << " (throught " << rtentry->GetGateway () << ") at the end");
2.16 + if(rtentry)
2.17 + {
2.18 + NS_LOG_LOGIC ("Matching route via " << rtentry->GetDestination () << " (throught " << rtentry->GetGateway () << ") at the end");
2.19 + }
2.20 return rtentry;
2.21 }
2.22
2.23 @@ -653,6 +655,11 @@
2.24 /* this case is mainly used by configuring default route following RA processing,
2.25 * in case of multipe prefix in RA, the first will configured default route
2.26 */
2.27 +
2.28 + /* for the moment, all default route has the same metric
2.29 + * so according to the longest prefix algorithm,
2.30 + * the default route choosen will be the last added
2.31 + */
2.32 SetDefaultRoute (nextHop, interface, prefixToUse);
2.33 }
2.34 }