Page MenuHomeFreeBSD

route(8): fix `route not found` exit code and warn with netlink
ClosedPublic

Authored by rcm on Sep 15 2023, 8:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 7:48 PM
Unknown Object (File)
Mar 13 2024, 12:47 AM
Unknown Object (File)
Mar 13 2024, 12:47 AM
Unknown Object (File)
Mar 13 2024, 12:47 AM
Unknown Object (File)
Mar 12 2024, 5:50 PM
Unknown Object (File)
Mar 9 2024, 10:55 AM
Unknown Object (File)
Mar 9 2024, 10:55 AM
Unknown Object (File)
Feb 12 2024, 2:23 PM
Subscribers

Details

Summary

Fix route(8) incorrectly returning a zero exit code even when unable to find
the specified route with route -n get <route>.

Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rcm requested review of this revision.Sep 15 2023, 8:26 PM
rcm created this revision.

I've not dug into it yet, but it looks like this causes the sys/netinet6 forward6:fwd_ip6_gu_icmp_gw_ll_fast_success and forward6:fwd_ip6_gu_icmp_gw_ll_slow_success tests to fail.

Sample output:

(kp@freebsd_current_zfs)  /usr/tests/sys/netinet6 % sudo kyua debug forward6:fwd_ip6_gu_icmp_gw_ll_slow_success                                                                    [11:05]
Executing command [ jexec v6t-fff4--8373 route add -6 -host 2001:db8:6666:0000::fff4:4:8373 fe80::6c:e4ff:fe29:e20a%epair0b ]
v6t-fff4--8373: removed
Fail: stderr not empty
--- /dev/null   2023-09-17 09:06:00.862100000 +0000
+++ /tmp/kyua.6ZklLH/2/work/check.jwEAdR/stderr 2023-09-17 09:06:00.859014000 +0000
@@ -0,0 +1 @@
+route: message indicates error: No error: 0
Files left in work directory after failure: created_interfaces.lst, created_jails.lst
ifconfig: interface epair0a does not exist
forward6:fwd_ip6_gu_icmp_gw_ll_slow_success  ->  failed: atf-check failed; see the output of the test for details

I'm not sure if this is because there's something wrong with the patch or because there's something wrong with the test though.

In D41882#954742, @kp wrote:

I've not dug into it yet, but it looks like this causes the sys/netinet6 forward6:fwd_ip6_gu_icmp_gw_ll_fast_success and forward6:fwd_ip6_gu_icmp_gw_ll_slow_success tests to fail.

Sample output:

(kp@freebsd_current_zfs)  /usr/tests/sys/netinet6 % sudo kyua debug forward6:fwd_ip6_gu_icmp_gw_ll_slow_success                                                                    [11:05]
Executing command [ jexec v6t-fff4--8373 route add -6 -host 2001:db8:6666:0000::fff4:4:8373 fe80::6c:e4ff:fe29:e20a%epair0b ]
v6t-fff4--8373: removed
Fail: stderr not empty
--- /dev/null   2023-09-17 09:06:00.862100000 +0000
+++ /tmp/kyua.6ZklLH/2/work/check.jwEAdR/stderr 2023-09-17 09:06:00.859014000 +0000
@@ -0,0 +1 @@
+route: message indicates error: No error: 0
Files left in work directory after failure: created_interfaces.lst, created_jails.lst
ifconfig: interface epair0a does not exist
forward6:fwd_ip6_gu_icmp_gw_ll_slow_success  ->  failed: atf-check failed; see the output of the test for details

I'm not sure if this is because there's something wrong with the patch or because there's something wrong with the test though.

Thanks for the tip, I will look into this.

Fix regression in forward6:fwd_ip6_gu_icmp_gw_ll_slow_success

This revision was not accepted when it landed; it landed in state Needs Review.Sep 19 2023, 5:39 PM
This revision was automatically updated to reflect the committed changes.