svn commit: r367163 - head/sys/net

Mitchell Horne mhorne at FreeBSD.org
Fri Oct 30 13:32:59 UTC 2020


Author: mhorne
Date: Fri Oct 30 13:32:58 2020
New Revision: 367163
URL: https://svnweb.freebsd.org/changeset/base/367163

Log:
  net: add ETHER_IS_IPV6_MULTICAST
  
  This can be used to detect if an ethernet address is specifically an
  IPv6 multicast address, defined in accordance to RFC 2464.
  
  ETHER_IS_MULTICAST is still preferred in the general case.
  
  Reviewed by:	ae
  Sponsored by:	NetApp, Inc.
  Sponsored by:	Klara, Inc.
  Differential Revision:	https://reviews.freebsd.org/D26611

Modified:
  head/sys/net/ethernet.h

Modified: head/sys/net/ethernet.h
==============================================================================
--- head/sys/net/ethernet.h	Fri Oct 30 10:46:35 2020	(r367162)
+++ head/sys/net/ethernet.h	Fri Oct 30 13:32:58 2020	(r367163)
@@ -71,6 +71,8 @@ struct ether_addr {
 } __packed;
 
 #define	ETHER_IS_MULTICAST(addr) (*(addr) & 0x01) /* is address mcast/bcast? */
+#define	ETHER_IS_IPV6_MULTICAST(addr) \
+	(((addr)[0] == 0x33) && ((addr)[1] == 0x33))
 #define	ETHER_IS_BROADCAST(addr) \
 	(((addr)[0] & (addr)[1] & (addr)[2] & \
 	  (addr)[3] & (addr)[4] & (addr)[5]) == 0xff)


More information about the svn-src-all mailing list