svn commit: r346596 - head/sys/netinet6

Konstantin Belousov kib at FreeBSD.org
Tue Sep 3 14:07:42 UTC 2019


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;




More information about the svn-src-head mailing list