From bb1abb2b213adceb606ff458e3786c8c2ea4dc8a Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 19 Feb 2015 14:02:07 +0000 Subject: [ipv4] Rewrite inet_aton() The implementation of inet_aton() has an unknown provenance. Rewrite this code to avoid potential licensing uncertainty. Also move the code from core/misc.c to its logical home in net/ipv4.c, and add a few extra test cases. Signed-off-by: Michael Brown --- src/tests/ipv4_test.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/tests') diff --git a/src/tests/ipv4_test.c b/src/tests/ipv4_test.c index ba18f8450..a72dcc51a 100644 --- a/src/tests/ipv4_test.c +++ b/src/tests/ipv4_test.c @@ -138,6 +138,8 @@ static void ipv4_test_exec ( void ) { inet_aton_fail_ok ( "256.0.0.1" ); /* Byte out of range */ inet_aton_fail_ok ( "212.13.204.60.1" ); /* Too long */ inet_aton_fail_ok ( "127.0.0" ); /* Too short */ + inet_aton_fail_ok ( "1.2.3.a" ); /* Invalid characters */ + inet_aton_fail_ok ( "127.0..1" ); /* Missing bytes */ } /** IPv4 self-test */ -- cgit v1.2.3-55-g7522