Page MenuHomeFreeBSD

Fix the IPv6 case in addr_resolve
AbandonedPublic

Authored by ngie on Nov 19 2015, 1:30 AM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 20 2024, 7:04 AM
Unknown Object (File)
Apr 10 2024, 6:26 PM
Unknown Object (File)
Dec 28 2023, 4:18 PM
Unknown Object (File)
Nov 15 2023, 11:11 PM
Unknown Object (File)
Nov 13 2023, 12:16 PM
Unknown Object (File)
Nov 9 2023, 11:37 AM
Unknown Object (File)
Nov 6 2023, 4:41 PM
Unknown Object (File)
Oct 25 2023, 8:27 AM

Details

Summary

Fix the IPv6 case in addr_resolve

  • Make sure sin is not NULL before comparing it against INADDR_ANY
  • Compare sin6->sin6_addr vs in6addr_any for the IPV6 case

This is a small-scale change that will eventually be refactored out in to
separate functions by upstream (Linux).

Reported by: Miles Ohlrich <miles.ohlrich@isilon.com>
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

Test Plan
  • Run tests on machines with IPv6/IPv6 static routes configured on ipoib interfaces
  • ssh between the machines with IPv6 addresses.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 1538
Build 1544: arc lint + arc unit

Event Timeline

ngie retitled this revision from to Fix the IPv6 case in addr_resolve.
ngie updated this object.
ngie edited the test plan for this revision. (Show Details)
ngie added reviewers: markj, hselasky.
ngie added a subscriber: benno.

style(9) fixups:

  • Upstream does if (sin), not if (sin != NULL)
  • Try and sorta match 80 columns

My test plan's incorrect. addr_resolve is used in two scenarios:

  • process_req (when the status of a request is ENODATA)
  • rdma_resolve_ip .

So I guess the easiest/most reliable way to test this out is to setup RDMA.

Hi,

Can we avoid repeating the address checks? I see one more NULL fault and that is when "multi != 0 and src_in == NULL".

--HPS

sys/ofed/drivers/infiniband/core/addr.c
247–248
else
    sin = NULL;
262
else {
  src_in = NULL;
  sin6 = NULL;
}
272

if (sin || sin6) {

hselasky added a subscriber: nish.mich_gmail.com.
hselasky added inline comments.
sys/ofed/drivers/infiniband/core/addr.c
262

possibly "multi = 0" should be added in the else above.

Hi, We are about to push a big patch to the ibcore that will fix this issue and some others.
It will change the resolving of ipv6 addr and more.
We will try to push it by the end of the year, or the beginning of January.
Do you think this fix can wait till then?

Hi, We are about to push a big patch to the ibcore that will fix this issue and some others.
It will change the resolving of ipv6 addr and more.
We will try to push it by the end of the year, or the beginning of January.
Do you think this fix can wait till then?

Hi Nish,

January's a ways away.. we (Isilon) have made some modifications that could also fix issues with ib that should be coordinated before the new code drop (some of the async code and callout paths were a big issue for us).

The goal of the bugfix was to make a minimal change that could be backported to maintenance releases without having to re-qualify the entire IB stack in our product. I'm almost done with a minimal change.

Thanks!
-NGie

  • Make sure both dst_in and src_in are set
  • Set sin/sin6 to NULL on failure and key off them being !NULL before testing whether or not the address is attached to a local interface

Needs to be tested still with our (Isilon's) IB stack

Please go ahead with this patch.

This revision is now accepted and ready to land.Jan 6 2016, 9:29 AM
ngie marked 3 inline comments as done.