changeset 2510:e46bc9fcf322 draft

Don't export empty RA options
author Roy Marples <roy@marples.name>
date Tue, 03 Jun 2014 09:32:01 +0000
parents 8b23a7553c3b
children e1ab5b72e192
files ipv6nd.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ipv6nd.c	Mon Jun 02 23:59:05 2014 +0000
+++ b/ipv6nd.c	Tue Jun 03 09:32:01 2014 +0000
@@ -1016,7 +1016,7 @@
 			    strcmp(rao->option, opt) == 0)
 				break;
 		}
-		if (lifetime == 0) {
+		if (lifetime == 0 || *opt == '\0') {
 			if (rao) {
 				TAILQ_REMOVE(&rap->options, rao, next);
 				free(rao->option);
@@ -1118,7 +1118,7 @@
 ssize_t
 ipv6nd_env(char **env, const char *prefix, const struct interface *ifp)
 {
-	size_t i, len, l;
+	size_t i, l, len;
 	const struct ra *rap;
 	const struct ra_opt *rao;
 	char buffer[32];
@@ -1144,7 +1144,7 @@
 			var = NULL;
 			switch(rao->type) {
 			case ND_OPT_PREFIX_INFORMATION:
-				optn = "prefix";
+				optn = "prefix"; /* really address */
 				var = &pref;
 				break;
 			case ND_OPT_MTU: