Skip to content

Commit 1e2e565

Browse files
mawilli1linvjw
authored andcommitted
[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 <mitch.a.williams@intel.com> Acked-by: Jay Vosburgh <fubar@us.ibm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent cd52d1e commit 1e2e565

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/core/utils.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ __u32 in_aton(const char *str)
175175
if (*str != '\0')
176176
{
177177
val = 0;
178-
while (*str != '\0' && *str != '.')
178+
while (*str != '\0' && *str != '.' && *str != '\n')
179179
{
180180
val *= 10;
181181
val += *str - '0';

0 commit comments

Comments
 (0)