Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Apr 2019 12:23:45 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r346596 - head/sys/netinet6
Message-ID:  <201904231223.x3NCNjd9045051@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Apr 23 12:23:44 2019
New Revision: 346596
URL: https://svnweb.freebsd.org/changeset/base/346596

Log:
  poib: assign link-local address according to RFC
  
  RFC 4391 specifies that the IB interface GID should be re-used as IPv6
  link-local address.  Since the code in in6_get_hw_ifid() ignored
  IFT_INFINIBAND case, ibX interfaces ended up with the local address
  borrowed from some other interface, which is non-compliant.
  
  Use lowest eight bytes from GID for filling the link-local address,
  same as Linux.
  
  Reviewed by:	bz (previous version), ae, hselasky, slavash,
  Sponsored by:	Mellanox Technologies
  MFC after:	1 week
  Differential revision:	https://reviews.freebsd.org/D20006

Modified:
  head/sys/netinet6/in6_ifattach.c

Modified: head/sys/netinet6/in6_ifattach.c
==============================================================================
--- head/sys/netinet6/in6_ifattach.c	Tue Apr 23 10:12:33 2019	(r346595)
+++ head/sys/netinet6/in6_ifattach.c	Tue Apr 23 12:23:44 2019	(r346596)
@@ -328,6 +328,14 @@ found:
 		NET_EPOCH_EXIT(et);
 		return -1;
 
+	case IFT_INFINIBAND:
+		if (addrlen != 20) {
+			NET_EPOCH_EXIT(et);
+			return -1;
+		}
+		bcopy(addr + 12, &in6->s6_addr[8], 8);
+		break;
+
 	default:
 		NET_EPOCH_EXIT(et);
 		return -1;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904231223.x3NCNjd9045051>