Permalink
Browse files

Temporary epair MAC address fix

/* Assign a hopefully unique, locally administered etheraddr. - for epairNa & epairNb */
  • Loading branch information...
plitc committed May 15, 2014
1 parent 401a161 commit 9215c5850ff562a44d0347fa03be60bd3cdd4b9c
Showing with 5 additions and 2 deletions.
  1. +5 −2 sys/net/if_epair.c
View
@@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
#include <sys/sockio.h>
#include <sys/sysctl.h>
#include <sys/types.h>
#include <sys/libkern.h>
#include <net/bpf.h>
#include <net/ethernet.h>
@@ -719,8 +720,9 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params)
if (params) {
scb = (struct epair_softc *)params;
ifp = scb->ifp;
/* Assign a hopefully unique, locally administered etheraddr. */
/* Assign a hopefully unique, locally administered etheraddr. -for epairNb- */
eaddr[0] = 0x02;
eaddr[1] = arc4random() & 0xff;
eaddr[3] = (ifp->if_index >> 8) & 0xff;
eaddr[4] = ifp->if_index & 0xff;
eaddr[5] = 0x0b;
@@ -814,8 +816,9 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params)
ifp->if_ioctl = epair_ioctl;
ifp->if_init = epair_init;
ifp->if_snd.ifq_maxlen = ifqmaxlen;
/* Assign a hopefully unique, locally administered etheraddr. */
/* Assign a hopefully unique, locally administered etheraddr. -for epairNa- */
eaddr[0] = 0x02;
eaddr[1] = arc4random() & 0xff;
eaddr[3] = (ifp->if_index >> 8) & 0xff;
eaddr[4] = ifp->if_index & 0xff;
eaddr[5] = 0x0a;

0 comments on commit 9215c58

Please sign in to comment.