Commit 1e2e5659656b8b9bd9fa4714355d91282cb74178

Authored by Mitch Williams
Committed by John W. Linville
1 parent cd52d1ee9a

[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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -175,7 +175,7 @@
175 175 if (*str != '\0')
176 176 {
177 177 val = 0;
178   - while (*str != '\0' && *str != '.')
  178 + while (*str != '\0' && *str != '.' && *str != '\n')
179 179 {
180 180 val *= 10;
181 181 val += *str - '0';