FreeBSD Bugzilla – Attachment 193114 Details for
Bug 184149
[vimage] IPv6 link-local collisions on epair[n]b devices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Another possible fix
epair-mac-b.patch (text/plain), 1.75 KB, created by
Luca Pizzamiglio
on 2018-05-06 20:56:48 UTC
(
hide
)
Description:
Another possible fix
Filename:
MIME Type:
Creator:
Luca Pizzamiglio
Created:
2018-05-06 20:56:48 UTC
Size:
1.75 KB
patch
obsolete
>Index: sys/net/if_epair.c >=================================================================== >--- sys/net/if_epair.c (revision 332357) >+++ sys/net/if_epair.c (working copy) >@@ -54,9 +54,12 @@ > > #include <sys/param.h> > #include <sys/kernel.h> >+#include <sys/jail.h> >+#include <sys/libkern.h> > #include <sys/malloc.h> > #include <sys/mbuf.h> > #include <sys/module.h> >+#include <sys/proc.h> > #include <sys/refcount.h> > #include <sys/queue.h> > #include <sys/smp.h> >@@ -713,6 +716,7 @@ > struct ifnet *ifp; > char *dp; > int error, unit, wildcard; >+ unsigned long hostid; > uint8_t eaddr[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */ > > /* >@@ -722,12 +726,18 @@ > * it cannot fail anymore. So just do attach it here. > */ > if (params) { >+ getcredhostid(curthread->td_ucred, &hostid ); >+ if ( hostid == 0 ) >+ arc4rand( &hostid, (sizeof(unsigned long)), 0); >+ > scb = (struct epair_softc *)params; > ifp = scb->ifp; > /* Assign a hopefully unique, locally administered etheraddr. */ > eaddr[0] = 0x02; >- eaddr[3] = (ifp->if_index >> 8) & 0xff; >- eaddr[4] = ifp->if_index & 0xff; >+ eaddr[1] = ( hostid >> 8 ) & 0xff; >+ eaddr[2] = hostid & 0xff; >+ eaddr[3] = (scb->oifp->if_index >> 8) & 0xff; >+ eaddr[4] = scb->oifp->if_index & 0xff; > eaddr[5] = 0x0b; > ether_ifattach(ifp, eaddr); > /* Correctly set the name for the cloner list. */ >@@ -836,7 +846,13 @@ > if_setsendqlen(ifp, ifqmaxlen); > if_setsendqready(ifp); > /* Assign a hopefully unique, locally administered etheraddr. */ >+ getcredhostid(curthread->td_ucred, &hostid ); >+ if ( hostid == 0 ) >+ arc4rand( &hostid, (sizeof(unsigned long)), 0); >+ > eaddr[0] = 0x02; >+ eaddr[1] = ( hostid >> 8 ) & 0xff; >+ eaddr[2] = hostid & 0xff; > eaddr[3] = (ifp->if_index >> 8) & 0xff; > eaddr[4] = ifp->if_index & 0xff; > eaddr[5] = 0x0a;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 184149
:
138234
| 193114