Lines Matching +full:entry +full:- +full:name

2 # SPDX-License-Identifier: GPL-2.0
27 if [ "$VERBOSE" -eq 1 ] && [ -n "$out" ]; then
39 set -e
43 ip -n "$ns1" link add veth0 type veth peer name veth1 netns "$ns2"
44 ip -n "$ns1" link set dev veth0 up
45 ip -n "$ns2" link set dev veth1 up
47 ip -n "$ns1" address add 192.0.2.1/24 dev veth0
48 ip -n "$ns1" address add 2001:db8:1::1/64 dev veth0 nodad
49 ip -n "$ns2" address add 192.0.2.2/24 dev veth1
50 ip -n "$ns2" address add 2001:db8:1::2/64 dev veth1 nodad
52 ip netns exec "$ns1" sysctl -qw net.ipv6.conf.all.keep_addr_on_down=1
53 ip netns exec "$ns2" sysctl -qw net.ipv6.conf.all.keep_addr_on_down=1
77 mac=$(ip -n "$ns2" -j link show dev veth1 | jq -r '.[]["address"]')
82 run_cmd "ip -n $ns1 neigh add $ip_addr lladdr $mac nud stale dev veth0 extern_valid"
83 run_cmd "ip -n $ns1 neigh get $ip_addr dev veth0 | grep \"extern_valid\""
86 log_test "$af_str \"extern_valid\" flag: Add entry"
90 # Check that an entry cannot be added with "extern_valid" flag and an
92 run_cmd "ip -n $ns1 neigh flush dev veth0"
93 run_cmd "ip -n $ns1 neigh add $ip_addr nud none dev veth0 extern_valid"
94 check_fail $? "Managed to add an entry with \"extern_valid\" flag and an invalid state"
100 # Check that entry cannot be added with both "extern_valid" flag and
102 run_cmd "ip -n $ns1 neigh flush dev veth0"
103 run_cmd "ip -n $ns1 neigh add $ip_addr lladdr $mac nud stale dev veth0 extern_valid use"
104 check_fail $? "Managed to add an entry with \"extern_valid\" flag and \"use\" flag"
111 run_cmd "ip -n $ns1 neigh flush dev veth0"
112 run_cmd "ip -n $ns1 neigh add $ip_addr lladdr $mac nud stale dev veth0"
113 run_cmd "ip -n $ns1 neigh replace $ip_addr lladdr $mac nud stale dev veth0 extern_valid"
114 run_cmd "ip -n $ns1 neigh get $ip_addr dev veth0 | grep \"extern_valid\""
116 run_cmd "ip -n $ns1 neigh replace $ip_addr lladdr $mac nud stale dev veth0"
117 run_cmd "ip -n $ns1 neigh get $ip_addr dev veth0 | grep \"extern_valid\""
120 log_test "$af_str \"extern_valid\" flag: Replace entry"
124 # Check that an existing "extern_valid" entry can be marked as
126 run_cmd "ip -n $ns1 neigh flush dev veth0"
127 run_cmd "ip -n $ns1 neigh add $ip_addr lladdr $mac nud stale dev veth0 extern_valid"
128 run_cmd "ip -n $ns1 neigh replace $ip_addr lladdr $mac nud stale dev veth0 extern_valid managed"
129 check_err $? "Did not manage to add \"managed\" flag to an existing \"extern_valid\" entry"
131 log_test "$af_str \"extern_valid\" flag: Replace entry with \"managed\" flag"
135 # Check that entry cannot be replaced with "extern_valid" flag and an
137 run_cmd "ip -n $ns1 neigh flush dev veth0"
138 run_cmd "ip -n $ns1 neigh add $ip_addr lladdr $mac nud stale dev veth0 extern_valid"
139 run_cmd "ip -n $ns1 neigh replace $ip_addr nud none dev veth0 extern_valid"
140 check_fail $? "Managed to replace an entry with \"extern_valid\" flag and an invalid state"
146 # Check that an "extern_valid" entry is flushed when the interface is
148 run_cmd "ip -n $ns1 neigh flush dev veth0"
149 run_cmd "ip -n $ns1 neigh add $ip_addr lladdr $mac nud stale dev veth0 extern_valid"
150 run_cmd "ip -n $ns1 link set dev veth0 down"
151 run_cmd "ip -n $ns1 link set dev veth0 up"
152 run_cmd "ip -n $ns1 neigh get $ip_addr dev veth0"
153 check_fail $? "\"extern_valid\" entry not flushed upon interface down"
159 # Check that an "extern_valid" entry is not flushed when the interface
161 run_cmd "ip -n $ns1 neigh flush dev veth0"
162 run_cmd "ip -n $ns1 neigh add $ip_addr lladdr $mac nud stale dev veth0 extern_valid"
163 run_cmd "ip -n $ns2 link set dev veth1 down"
164 run_cmd "ip -n $ns2 link set dev veth1 up"
166 run_cmd "ip -n $ns1 neigh get $ip_addr dev veth0"
167 check_err $? "\"extern_valid\" entry flushed upon carrier down"
173 # Check that when entry transitions to "reachable" state it maintains
178 delay_probe=$(ip -n "$ns1" -j ntable show dev veth0 name "$tbl_name" | jq '.[]["delay_probe"]')
179 run_cmd "ip -n $ns1 neigh flush dev veth0"
180 run_cmd "ip -n $ns1 neigh add $ip_addr lladdr $mac nud stale dev veth0 extern_valid"
181 run_cmd "ip -n $ns1 neigh replace $ip_addr lladdr $mac nud stale dev veth0 extern_valid use"
183 run_cmd "ip -n $ns1 neigh get $ip_addr dev veth0 | grep \"REACHABLE\""
184 check_err $? "Entry did not transition to \"reachable\" state"
185 run_cmd "ip -n $ns1 neigh get $ip_addr dev veth0 | grep \"extern_valid\""
186 check_err $? "Entry did not maintain \"extern_valid\" flag after transition to \"reachable\" state"
192 # Drop all packets, trigger resolution and check that entry goes back
201 run_cmd "ip -n $ns1 neigh flush dev veth0"
202 run_cmd "tc -n $ns2 qdisc add dev veth1 clsact"
203 run_cmd "tc -n $ns2 filter add dev veth1 ingress proto all matchall action drop"
204 run_cmd "ip -n $ns1 neigh add $ip_addr lladdr $mac nud stale dev veth0 extern_valid"
205 run_cmd "ip -n $ns1 neigh replace $ip_addr lladdr $mac nud stale dev veth0 extern_valid use"
206 retrans_time=$(ip -n "$ns1" -j ntable show dev veth0 name "$tbl_name" | jq '.[]["retrans"]')
207 ucast_probes=$(ip -n "$ns1" -j ntable show dev veth0 name "$tbl_name" | jq '.[]["ucast_probes"]')
208 app_probes=$(ip -n "$ns1" -j ntable show dev veth0 name "$tbl_name" | jq '.[]["app_probes"]')
209 …mcast_reprobes=$(ip -n "$ns1" -j ntable show dev veth0 name "$tbl_name" | jq '.[]["mcast_reprobes"…
212 run_cmd "ip -n $ns1 neigh get $ip_addr dev veth0 | grep \"STALE\""
213 check_err $? "Entry did not return to \"stale\" state"
214 run_cmd "ip -n $ns1 neigh get $ip_addr dev veth0 | grep \"extern_valid\""
215 check_err $? "Entry did not maintain \"extern_valid\" flag after returning to \"stale\" state"
216 probes=$(ip -n "$ns1" -j -s neigh get "$ip_addr" dev veth0 | jq '.[]["probes"]')
217 if [[ $probes -eq 0 ]]; then
223 run_cmd "tc -n $ns2 qdisc del dev veth1 clsact"
231 # Check that an "extern_valid" entry survives a forced garbage
232 # collection. Add an entry, wait 5 seconds and add more entries than
243 run_cmd "ip -n $ns1 neigh flush dev veth0"
244 …orig_thresh1=$(ip -j ntable show name "$tbl_name" | jq '.[] | select(has("thresh1")) | .["thresh1"…
245 …orig_thresh2=$(ip -j ntable show name "$tbl_name" | jq '.[] | select(has("thresh2")) | .["thresh2"…
246 …orig_thresh3=$(ip -j ntable show name "$tbl_name" | jq '.[] | select(has("thresh3")) | .["thresh3"…
247 run_cmd "ip ntable change name $tbl_name thresh3 10 thresh2 9 thresh1 8"
248 run_cmd "ip -n $ns1 neigh add $ip_addr lladdr $mac nud stale dev veth0 extern_valid"
249 run_cmd "ip -n $ns1 neigh add ${subnet}3 lladdr $mac nud stale dev veth0"
251 …forced_gc_runs_t0=$(ip -j -s ntable show name "$tbl_name" | jq '.[] | select(has("forced_gc_runs")…
253 run_cmd "ip -n $ns1 neigh add ${subnet}$((i + 4)) nud none dev veth0"
255 …forced_gc_runs_t1=$(ip -j -s ntable show name "$tbl_name" | jq '.[] | select(has("forced_gc_runs")…
256 if [[ $forced_gc_runs_t1 -eq $forced_gc_runs_t0 ]]; then
259 run_cmd "ip -n $ns1 neigh get $ip_addr dev veth0 | grep \"extern_valid\""
260 check_err $? "Entry with \"extern_valid\" flag did not survive forced garbage collection"
261 run_cmd "ip -n $ns1 neigh get ${subnet}3 dev veth0"
262 check_fail $? "Entry without \"extern_valid\" flag survived forced garbage collection"
266 …run_cmd "ip ntable change name $tbl_name thresh3 $orig_thresh3 thresh2 $orig_thresh2 thresh1 $orig…
274 # Check that an "extern_valid" entry survives a periodic garbage
275 # collection. Add an "extern_valid" entry, add more than "thresh1"
277 # seconds and check that the "extern_valid" entry was not deleted.
287 run_cmd "ip -n $ns1 neigh flush dev veth0"
288 …orig_thresh1=$(ip -j ntable show name "$tbl_name" | jq '.[] | select(has("thresh1")) | .["thresh1"…
289 …orig_base_reachable=$(ip -j ntable show name "$tbl_name" | jq '.[] | select(has("thresh1")) | .["b…
290 run_cmd "ip ntable change name $tbl_name thresh1 10 base_reachable 10000"
291 orig_gc_stale=$(ip -n "$ns1" -j ntable show name "$tbl_name" dev veth0 | jq '.[]["gc_stale"]')
292 run_cmd "ip -n $ns1 ntable change name $tbl_name dev veth0 gc_stale 1000"
293 run_cmd "ip -n $ns1 neigh add $ip_addr lladdr $mac nud stale dev veth0 extern_valid"
294 run_cmd "ip -n $ns1 neigh add ${subnet}3 lladdr $mac nud stale dev veth0"
298 run_cmd "ip -n $ns1 neigh add ${subnet}$((i + 4)) nud none dev veth0"
300 …periodic_gc_runs_t0=$(ip -j -s ntable show name "$tbl_name" | jq '.[] | select(has("periodic_gc_ru…
302 …periodic_gc_runs_t1=$(ip -j -s ntable show name "$tbl_name" | jq '.[] | select(has("periodic_gc_ru…
303 [[ $periodic_gc_runs_t1 -ne $periodic_gc_runs_t0 ]]
305 run_cmd "ip -n $ns1 neigh get $ip_addr dev veth0 | grep \"extern_valid\""
306 check_err $? "Entry with \"extern_valid\" flag did not survive periodic garbage collection"
307 run_cmd "ip -n $ns1 neigh get ${subnet}3 dev veth0"
308 check_fail $? "Entry without \"extern_valid\" flag survived periodic garbage collection"
312 run_cmd "ip -n $ns1 ntable change name $tbl_name dev veth0 gc_stale $orig_gc_stale"
313 run_cmd "ip ntable change name $tbl_name thresh1 $orig_thresh1 base_reachable $orig_base_reachable"
334 -t <test> Test(s) to run (default: all)
336 -p Pause on fail
337 -v Verbose mode (show commands and output)
356 if ! ip neigh help 2>&1 | grep -q "extern_valid"; then