Created attachment 204589 [details] Set rt and ifp variables when opts->ip6po_nexthop is present Since I migrated to FreeBSD11.2, the -g option of ping6 is broken. The command does always return the error "ping6: sendmsg: No route to host". Having a llok at the code, it seems that this regression was caused by the commit https://svnweb.freebsd.org/base?view=revision&revision=286195, were the handling of the IPV6_NEXTHOP option was changed. The bug seems to be caused by the fact that when exiting the bloc who check the presence of the flag opts->ip6po_nexthop, the variables rt and ifp aren't set anymore. Setting rt and ifp seems to fix the problem (see the attached diff).
Thank you for the report and patch Masse
A commit references this bug: Author: ae Date: Fri May 24 11:45:33 UTC 2019 New revision: 348236 URL: https://svnweb.freebsd.org/changeset/base/348236 Log: Restore IPV6_NEXTHOP option support that seem was partially broken since r286195. Do not forget results of route lookup and initialize rt and ifp pointers. PR: 238098 Submitted by: Masse Nicolas <nicolas.masse at stormshield eu> MFC after: 1 week Changes: head/sys/netinet6/in6_src.c
A commit references this bug: Author: ae Date: Fri May 31 11:21:31 UTC 2019 New revision: 348455 URL: https://svnweb.freebsd.org/changeset/base/348455 Log: MFC r348236: Restore IPV6_NEXTHOP option support that seem was partially broken since r286195. Do not forget results of route lookup and initialize rt and ifp pointers. PR: 238098 Submitted by: Masse Nicolas <nicolas.masse at stormshield eu> Changes: _U stable/12/ stable/12/sys/netinet6/in6_src.c
A commit references this bug: Author: ae Date: Fri May 31 17:18:09 UTC 2019 New revision: 348470 URL: https://svnweb.freebsd.org/changeset/base/348470 Log: MFC r348236: Restore IPV6_NEXTHOP option support that seem was partially broken since r286195. Do not forget results of route lookup and initialize rt and ifp pointers. PR: 238098 Submitted by: Masse Nicolas <nicolas.masse at stormshield eu> Approved by: re (gjb) Changes: _U stable/11/ stable/11/sys/netinet6/in6_src.c
Fixed in head/, stable/12 and stable/11 branches, thanks!