From: Mitch Williams Date: Wed, 9 Nov 2005 18:34:01 +0000 (-0800) Subject: [PATCH] net: allow newline terminated IP addresses in in_aton X-Git-Tag: v2.6.16-rc1~474^2~22^2~7^2~96^2~17 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e2e5659656b8b9bd9fa4714355d91282cb74178;p=linux-2.6 [PATCH] net: allow newline terminated IP addresses in in_aton in_aton() gives weird results if it sees a newline at the end of the input. This patch makes it able to handle such input correctly. Signed-off-by: Mitch Williams Acked-by: Jay Vosburgh Signed-off-by: John W. Linville --- diff --git a/net/core/utils.c b/net/core/utils.c index 7b5970fc9e..587eb7787d 100644 --- a/net/core/utils.c +++ b/net/core/utils.c @@ -175,7 +175,7 @@ __u32 in_aton(const char *str) if (*str != '\0') { val = 0; - while (*str != '\0' && *str != '.') + while (*str != '\0' && *str != '.' && *str != '\n') { val *= 10; val += *str - '0';