Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/net/ndp Make a permanet neighbor cache to avoid sendin...



details:   https://anonhg.NetBSD.org/src/rev/356dbe3c7d31
branches:  trunk
changeset: 458844:356dbe3c7d31
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Tue Aug 13 07:20:43 2019 +0000

description:
Make a permanet neighbor cache to avoid sending an NS packet disturbing the test

A receiver of an ICMPv6 request packet creates a stale cache entry and it turns
into the delay state on replying the packet.  After 5 second, the receiver sends
an NS packet as a reachability confirmation, which disturbs the test and causes
a unexpected result.

Should fix PR misc/54451

diffstat:

 tests/net/ndp/t_ndp.sh |  26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diffs (69 lines):

diff -r 856337c13cbe -r 356dbe3c7d31 tests/net/ndp/t_ndp.sh
--- a/tests/net/ndp/t_ndp.sh    Tue Aug 13 07:09:49 2019 +0000
+++ b/tests/net/ndp/t_ndp.sh    Tue Aug 13 07:20:43 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_ndp.sh,v 1.33 2019/07/18 04:00:09 ozaki-r Exp $
+#      $NetBSD: t_ndp.sh,v 1.34 2019/08/13 07:20:43 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -114,6 +114,7 @@
 
 ndp_cache_expiration_body()
 {
+       local macaddr=
 
        rump_server_start $SOCKSRC netinet6
        rump_server_start $SOCKDST netinet6
@@ -121,12 +122,19 @@
        setup_dst_server
        setup_src_server
 
+       # Shorten the expire time of cache entries
        export RUMP_SERVER=$SOCKSRC
-
-       # Shorten the expire time of cache entries
        atf_check -s exit:0 -o match:'basereachable=7s0ms' \
            rump.ndp -i shmif0 basereachable=7000
 
+       # Make a permanent cache entry to avoid sending an NS packet disturbing
+       # the test
+       macaddr=$(get_macaddr $SOCKSRC shmif0)
+       export RUMP_SERVER=$SOCKDST
+       atf_check -s exit:0 -o ignore rump.ndp -s $IP6SRC $macaddr
+
+       export RUMP_SERVER=$SOCKSRC
+
        #
        # Check if a cache is expired expectedly
        #
@@ -710,6 +718,7 @@
 
 ndp_cache_state_body()
 {
+       local macaddr=
 
        rump_server_start $SOCKSRC netinet6
        rump_server_start $SOCKDST netinet6
@@ -717,12 +726,19 @@
        setup_dst_server
        setup_src_server
 
+       # Shorten the expire time of cache entries
        export RUMP_SERVER=$SOCKSRC
-
-       # Shorten the expire time of cache entries
        atf_check -s exit:0 -o match:'basereachable=7s0ms' \
            rump.ndp -i shmif0 basereachable=7000
 
+       # Make a permanent cache entry to avoid sending an NS packet disturbing
+       # the test
+       macaddr=$(get_macaddr $SOCKSRC shmif0)
+       export RUMP_SERVER=$SOCKDST
+       atf_check -s exit:0 -o ignore rump.ndp -s $IP6SRC $macaddr
+
+       export RUMP_SERVER=$SOCKSRC
+
        #
        # Reachability confirmation (RFC 4861 7.3.3)
        #



Home | Main Index | Thread Index | Old Index