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)
Thu, Nov 7, 11:31 AM
Unknown Object (File)
Sun, Oct 20, 2:42 AM
Unknown Object (File)
Oct 2 2024, 6:16 AM
Unknown Object (File)
Sep 30 2024, 4:44 AM
Unknown Object (File)
Sep 24 2024, 9:22 AM
Unknown Object (File)
Sep 21 2024, 6:08 AM
Unknown Object (File)
Sep 13 2024, 12:47 AM
Unknown Object (File)
Sep 2 2024, 4:44 AM
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.