提交 1e2e5659 编写于 作者: M Mitch Williams 提交者: John W. Linville

[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: NMitch Williams <mitch.a.williams@intel.com>
Acked-by: NJay Vosburgh <fubar@us.ibm.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 cd52d1ee
...@@ -175,7 +175,7 @@ __u32 in_aton(const char *str) ...@@ -175,7 +175,7 @@ __u32 in_aton(const char *str)
if (*str != '\0') if (*str != '\0')
{ {
val = 0; val = 0;
while (*str != '\0' && *str != '.') while (*str != '\0' && *str != '.' && *str != '\n')
{ {
val *= 10; val *= 10;
val += *str - '0'; val += *str - '0';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册