Bug 238098 - Setting the -g option to ping6 doesn't work
Summary: Setting the -g option to ping6 doesn't work
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.2-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Andrey V. Elsukov
URL:
Keywords: easy, regression
Depends on:
Blocks:
 
Reported: 2019-05-24 10:09 UTC by Masse Nicolas
Modified: 2019-06-27 10:47 UTC (History)
2 users (show)

See Also:
koobs: mfc-stable12+
koobs: mfc-stable11+


Attachments
Set rt and ifp variables when opts->ip6po_nexthop is present (324 bytes, patch)
2019-05-24 10:09 UTC, Masse Nicolas
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Masse Nicolas 2019-05-24 10:09:24 UTC
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).
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2019-05-24 10:34:12 UTC
Thank you for the report and patch Masse
Comment 2 commit-hook freebsd_committer freebsd_triage 2019-05-24 11:46:03 UTC
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
Comment 3 commit-hook freebsd_committer freebsd_triage 2019-05-31 11:21:48 UTC
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
Comment 4 commit-hook freebsd_committer freebsd_triage 2019-05-31 17:18:49 UTC
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
Comment 5 Andrey V. Elsukov freebsd_committer freebsd_triage 2019-05-31 17:20:32 UTC
Fixed in head/, stable/12 and stable/11 branches, thanks!