On Friday 16 October 2009 11:05, Maciek Borzecki wrote:
> There's an issue with 1.13.x and 1.14.x version wrt. whitespace
> handling in netmask entry in /etc/network/interfaces. If there is more
> than single whitespace between netmask and address the
> count_netmask_bits will return bogs value (uint32_t)-1. This will
> result in ip complaining about netmask and spitting out the following
> line:
> Error: an inet prefix is expected rather than "10.10.17.99/4294967295"
> 
> Looking at the code the issue should still be valid in 1.15.x. The
> patch was submitted to debian bug report here:
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=503230
> Indeed, the patch seems to fix the issue. It might be reasonable to merge it.

By doing this fix in a different place, we maybe covering more cases.
Please test attached patch.
--
vda
diff -d -urpN busybox.2/networking/ifupdown.c busybox.3/networking/ifupdown.c
--- busybox.2/networking/ifupdown.c	2009-10-10 00:46:47.000000000 +0200
+++ busybox.3/networking/ifupdown.c	2009-10-16 23:55:22.000000000 +0200
@@ -644,6 +644,9 @@ static const struct address_family_t add
 
 #endif	/* if ENABLE_FEATURE_IFUPDOWN_IPV4 */
 
+/* Returns pointer to the next word, or NULL.
+ * In 1st case, advances *buf to the word after this one.
+ */
 static char *next_word(char **buf)
 {
 	unsigned length;
@@ -663,7 +666,7 @@ static char *next_word(char **buf)
 	if (word[length] != '\0')
 		word[length++] = '\0';
 
-	*buf = word + length;
+	*buf = skip_whitespace(word + length);
 
 	return word;
 }
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to