Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net/lagg lagg: clear I/G bitg and set G/L bit in a gener...



details:   https://anonhg.NetBSD.org/src/rev/d56e4b1d1773
branches:  trunk
changeset: 1024329:d56e4b1d1773
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Tue Oct 19 07:40:52 2021 +0000

description:
lagg: clear I/G bitg and set G/L bit in a generated MAC address

diffstat:

 sys/net/lagg/if_lagg.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 3adf5204c090 -r d56e4b1d1773 sys/net/lagg/if_lagg.c
--- a/sys/net/lagg/if_lagg.c    Tue Oct 19 06:41:03 2021 +0000
+++ b/sys/net/lagg/if_lagg.c    Tue Oct 19 07:40:52 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_lagg.c,v 1.13 2021/10/12 08:30:58 yamaguchi Exp $   */
+/*     $NetBSD: if_lagg.c,v 1.14 2021/10/19 07:40:52 yamaguchi Exp $   */
 
 /*
  * Copyright (c) 2005, 2006 Reyk Floeter <reyk%openbsd.org@localhost>
@@ -20,7 +20,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_lagg.c,v 1.13 2021/10/12 08:30:58 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_lagg.c,v 1.14 2021/10/19 07:40:52 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -416,6 +416,8 @@
        switch (lagg_iftype) {
        case LAGG_IF_TYPE_ETHERNET:
                cprng_fast(sc->sc_lladdr_rand, sizeof(sc->sc_lladdr_rand));
+               sc->sc_lladdr_rand[0] &= 0xFE; /* clear I/G bit */
+               sc->sc_lladdr_rand[0] |= 0x02; /* set G/L bit */
                lagg_lladdr_cpy(sc->sc_lladdr, sc->sc_lladdr_rand);
                ether_set_vlan_cb((struct ethercom *)ifp, lagg_vlan_cb);
                ether_ifattach(ifp, sc->sc_lladdr);



Home | Main Index | Thread Index | Old Index