changeset 5372:a64688cee252 draft

inet6: No flags on the prefix means the prefix is via the router Fixes a minor regression from prior.
author Roy Marples <roy@marples.name>
date Wed, 17 Jun 2020 09:42:32 +0100
parents 0c4a9b4da8e6
children 086c01fecfca
files src/ipv6nd.c
diffstat 1 files changed, 4 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/ipv6nd.c	Tue Jun 16 20:58:17 2020 +0100
+++ b/src/ipv6nd.c	Wed Jun 17 09:42:32 2020 +0100
@@ -1339,7 +1339,9 @@
 				continue;
 			}
 
-			flags = 0;
+			flags = IPV6_AF_RAPFX;
+			/* If no flags are set, that means the prefix is
+			 * available via the router. */
 			if (pi.nd_opt_pi_flags_reserved & ND_OPT_PI_FLAG_ONLINK)
 				flags |= IPV6_AF_ONLINK;
 			if (pi.nd_opt_pi_flags_reserved & ND_OPT_PI_FLAG_AUTO &&
@@ -1348,20 +1350,12 @@
 				flags |= IPV6_AF_AUTOCONF;
 			if (pi.nd_opt_pi_flags_reserved & ND_OPT_PI_FLAG_ROUTER)
 				flags |= IPV6_AF_ROUTER;
-			if (flags == 0) {
-				logmessage(loglevel,
-				    "%s: prefix information option"
-				    " with unknown flags",
-				    ifp->name);
-				continue;
-			}
 
 			ia = ipv6nd_rapfindprefix(rap,
 			    &pi_prefix, pi.nd_opt_pi_prefix_len);
 			if (ia == NULL) {
 				ia = ipv6_newaddr(rap->iface,
-				    &pi_prefix, pi.nd_opt_pi_prefix_len,
-				    flags | IPV6_AF_RAPFX);
+				    &pi_prefix, pi.nd_opt_pi_prefix_len, flags);
 				if (ia == NULL)
 					break;
 				ia->prefix = pi_prefix;