Skip to contentSkip to conversation

ipneigh01.sh: Add workaround for ARP timeout

PATCH In review Petr Vorel 2 participants 2 messages Sep 22, 2023 – Nov 23, 2023

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH v2 1/1 ipneigh01.sh: Add workaround for ARP timeout

From: Xu Senmiao <[email protected]>

When the ARP status of the rhost is stale, lhost ping rhost and the lhost deletes the ARP record, the record in the rhost changes from stale to delay.

Then, the probe request is sent to the lhost, and the lhost ARP information is updated.

rhost(10.0.0.1) lhost(10.0.0.2)
t1 10.0.0.2 STALE ping 10.0.0.1

                        10.0.0.1 REACHABLE
                        arp -d 10.0.0.1

t2 10.0.0.2 DELAY
t3 probe 10.0.0.2
t4 10.0.0.1 REACHABLE

Clear the ARP entries of rhost before each round of test. This fixes an issue where ipneigh01_arp fail due to ARP timeout.

[ pvorel: use $DEL_CMD ]

---
Changes v1->v2:
* Using DEL_CMD to fix working on system without arp installed.

Xu, can you confirm that it fixes your problem?
Also, do you have this problem also on IPv6?
Could you test both arp and ip?
Also, do you have any idea why rhost get stale?

Kind regards,
Petr

 testcases/network/tcp_cmds/ipneigh/ipneigh01.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
testcases/network/tcp_cmds/ipneigh/ipneigh01.sh +4 -3
index e67ff5cc8..f37241d49 100755
@@ -19,14 +19,14 @@ do_setup()
 	case $CMD in
 	ip)
 		SHOW_CMD="ip neigh show"
-		DEL_CMD="ROD ip neigh del $(tst_ipaddr rhost) dev $(tst_iface)"
+		DEL_CMD="ip neigh del $(tst_ipaddr rhost) dev $(tst_iface)"
 		;;
 	arp)
 		if [ -n "$TST_IPV6" ]; then
 			tst_brk TCONF "'arp' doesn't support IPv6"
 		fi
 		SHOW_CMD="arp -an"
-		DEL_CMD="ROD arp -d $(tst_ipaddr rhost) -i $(tst_iface)"
+		DEL_CMD="arp -d $(tst_ipaddr rhost) -i $(tst_iface)"
 		;;
 	*)
 		tst_brk TBROK "unknown or missing command, use -c [ arp | ip ]"
@@ -56,6 +56,7 @@ do_test()
 	tst_res TINFO "stress auto-creation $entry_name cache entry deleted with '$CMD' $NUMLOOPS times"
 
 	for i in $(seq 1 $NUMLOOPS); do
+		$DEL_CMD
 
 		ping$TST_IPV6 -q -c1 $(tst_ipaddr rhost) -I $(tst_iface) > /dev/null || \
 			tst_brk TFAIL "cannot ping $(tst_ipaddr rhost)"
@@ -74,7 +75,7 @@ do_test()
 		[ "$ret" -ne 0 ] && \
 			tst_brk TFAIL "$entry_name entry '$(tst_ipaddr rhost)' not listed"
 
-		$DEL_CMD
+		ROD $DEL_CMD
 
 		$SHOW_CMD | grep -q "$(tst_ipaddr rhost).*$(tst_hwaddr rhost)" && \
 			tst_brk TFAIL "'$DEL_CMD' failed, entry has " \
Signature · 5 lines
2.40.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hello

Quoted 23 lines · Petr Vorel

From: Xu Senmiao <[email protected]>

When the ARP status of the rhost is stale, lhost ping rhost and the lhost deletes the ARP record, the record in the rhost changes from stale to delay.

Then, the probe request is sent to the lhost, and the lhost ARP information is updated.

   rhost(10.0.0.1)      lhost(10.0.0.2)
t1 10.0.0.2 STALE       ping 10.0.0.1
                        10.0.0.1 REACHABLE
                        arp -d 10.0.0.1

t2 10.0.0.2 DELAY
t3 probe 10.0.0.2
t4 10.0.0.1 REACHABLE

Clear the ARP entries of rhost before each round of test. This fixes an issue where ipneigh01_arp fail due to ARP timeout.

[ pvorel: use $DEL_CMD ]
Quoted 8 lines

---
Changes v1->v2:
* Using DEL_CMD to fix working on system without arp installed.

Xu, can you confirm that it fixes your problem?
Also, do you have this problem also on IPv6?
Could you test both arp and ip?
Also, do you have any idea why rhost get stale?

We need an answer to why the rhost is stale before merging this. It's not clear that there is a test bug.

I will set this to changes requested in patchwork.

Quoted 47 lines

Kind regards,
Petr

 testcases/network/tcp_cmds/ipneigh/ipneigh01.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
testcases/network/tcp_cmds/ipneigh/ipneigh01.sh +4 -3
index e67ff5cc8..f37241d49 100755
@@ -19,14 +19,14 @@ do_setup()
 	case $CMD in
 	ip)
 		SHOW_CMD="ip neigh show"
-		DEL_CMD="ROD ip neigh del $(tst_ipaddr rhost) dev $(tst_iface)"
+		DEL_CMD="ip neigh del $(tst_ipaddr rhost) dev $(tst_iface)"
 		;;
 	arp)
 		if [ -n "$TST_IPV6" ]; then
 			tst_brk TCONF "'arp' doesn't support IPv6"
 		fi
 		SHOW_CMD="arp -an"
-		DEL_CMD="ROD arp -d $(tst_ipaddr rhost) -i $(tst_iface)"
+		DEL_CMD="arp -d $(tst_ipaddr rhost) -i $(tst_iface)"
 		;;
 	*)
 		tst_brk TBROK "unknown or missing command, use -c [ arp | ip ]"
@@ -56,6 +56,7 @@ do_test()
 	tst_res TINFO "stress auto-creation $entry_name cache entry deleted with '$CMD' $NUMLOOPS times"
 
 	for i in $(seq 1 $NUMLOOPS); do
+		$DEL_CMD
 
 		ping$TST_IPV6 -q -c1 $(tst_ipaddr rhost) -I $(tst_iface) > /dev/null || \
 			tst_brk TFAIL "cannot ping $(tst_ipaddr rhost)"
@@ -74,7 +75,7 @@ do_test()
 		[ "$ret" -ne 0 ] && \
 			tst_brk TFAIL "$entry_name entry '$(tst_ipaddr rhost)' not listed"
 
-		$DEL_CMD
+		ROD $DEL_CMD
 
 		$SHOW_CMD | grep -q "$(tst_ipaddr rhost).*$(tst_hwaddr rhost)" && \
 			tst_brk TFAIL "'$DEL_CMD' failed, entry has " \
Signature · 1 line
2.40.1
Signature · 5 lines
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp