Re: svn commit: r314471 - head/sys/net
Warner Loshwrote in <201703010447.v214lm4c026...@repo.freebsd.org>: im> Author: imp im> Date: Wed Mar 1 04:47:22 2017 im> New Revision: 314471 im> URL: https://svnweb.freebsd.org/changeset/base/314471 im> im> Log: im> Fix VNET - DAD detected duplicate IPv6 address im> im> Assign a hopefully unique, locally administered etheraddr. - for im> epairNa & epairNb im> im> Submitted by: Catalin im> Pull Request: https://github.com/freebsd/freebsd/pull/92 This was discussed in D1858. epairNa and epairNb never have the same L2 addr because eaddr[5] is unique. If the goal of this change is to prevent a conflict of L2 addrs with epairNs created in another vnet jail on the same system or on the same network, eaddr[5] of epairNa (around l.839) must also be randomized at least. While I am still for a deterministic value because changing the L2 addr every time when rebooting a vnet jail is annoying, but if we use some random numbers for the vendor bits, I think eaddr[2] should be initialized in the same way. -- Hiroki pgpz33cXRJO21.pgp Description: PGP signature
Re: svn commit: r314471 - head/sys/net
On Tue, Feb 28, 2017 at 10:18 PM, Hiroki Satowrote: > Warner Losh wrote > in <201703010447.v214lm4c026...@repo.freebsd.org>: > > im> Author: imp > im> Date: Wed Mar 1 04:47:22 2017 > im> New Revision: 314471 > im> URL: https://svnweb.freebsd.org/changeset/base/314471 > im> > im> Log: > im> Fix VNET - DAD detected duplicate IPv6 address > im> > im> Assign a hopefully unique, locally administered etheraddr. - for > im> epairNa & epairNb > im> > im> Submitted by: Catalin > im> Pull Request: https://github.com/freebsd/freebsd/pull/92 > > This was discussed in D1858. epairNa and epairNb never have the same > L2 addr because eaddr[5] is unique. If the goal of this change is to > prevent a conflict of L2 addrs with epairNs created in another vnet > jail on the same system or on the same network, eaddr[5] of epairNa > (around l.839) must also be randomized at least. > > While I am still for a deterministic value because changing the L2 > addr every time when rebooting a vnet jail is annoying, but if we use > some random numbers for the vendor bits, I think eaddr[2] should be > initialized in the same way. It's clear the consensus there was 'no go' and I don't wish to override it. I didn't know about that, so I'll revert. Warner ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r314471 - head/sys/net
Author: imp Date: Wed Mar 1 04:47:22 2017 New Revision: 314471 URL: https://svnweb.freebsd.org/changeset/base/314471 Log: Fix VNET - DAD detected duplicate IPv6 address Assign a hopefully unique, locally administered etheraddr. - for epairNa & epairNb Submitted by: CatalinPull Request: https://github.com/freebsd/freebsd/pull/92 Modified: head/sys/net/if_epair.c Modified: head/sys/net/if_epair.c == --- head/sys/net/if_epair.c Wed Mar 1 04:41:59 2017(r314470) +++ head/sys/net/if_epair.c Wed Mar 1 04:47:22 2017(r314471) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -724,6 +725,7 @@ epair_clone_create(struct if_clone *ifc, ifp = scb->ifp; /* Assign a hopefully unique, locally administered etheraddr. */ eaddr[0] = 0x02; + eaddr[1] = arc4random() & 0xff; eaddr[3] = (ifp->if_index >> 8) & 0xff; eaddr[4] = ifp->if_index & 0xff; eaddr[5] = 0x0b; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"