NetBSD-Bugs archive

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

Re: kern/48309: msk(4) cannot change link address



On Sun, 13 Oct 2013 20:15:00 +0000 (UTC)
David Holland <dholland-bugs%netbsd.org@localhost> wrote:

> The following reply was made to PR kern/48309; it has been noted by GNATS.
> 
> From: David Holland <dholland-bugs%netbsd.org@localhost>
> To: gnats-bugs%NetBSD.org@localhost
> Cc: 
> Subject: Re: kern/48309: msk(4) cannot change link address
> Date: Sun, 13 Oct 2013 20:12:29 +0000
> 
>  On Sun, Oct 13, 2013 at 04:50:00PM +0000, Takahiro HAYASHI wrote:
>   > >Fix:
>   >   Please fill sc_if->sk_enaddr with CLLADDR(ifp->if_sadl) before
>   >   writing to unicast filter registers in msk_init_yukon().
>  
>  If you prepare a patch (either for this or 48310), I expect it will
>  get committed rapidly...

This is the patch for HEAD, netbsd-6 and netbsd-5.


Index: src/sys/dev/pci/if_msk.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_msk.c,v
retrieving revision 1.43
diff -u -p -r1.43 if_msk.c
--- src/sys/dev/pci/if_msk.c    30 Mar 2013 03:21:06 -0000      1.43
+++ src/sys/dev/pci/if_msk.c    29 Sep 2013 13:35:13 -0000
@@ -2036,6 +2036,11 @@ msk_init_yukon(struct sk_if_softc *sc_if
 
        DPRINTFN(6, ("msk_init_yukon: 10\n"));
        /* Setup Yukon's address */
+       struct ifnet *ifp = &sc_if->sk_ethercom.ec_if;
+       /* msk_attach calls me before ether_ifattach so check null */
+       if (ifp != NULL && ifp->if_sadl != NULL)
+               memcpy(sc_if->sk_enaddr, CLLADDR(ifp->if_sadl),
+                   sizeof(sc_if->sk_enaddr));
        for (i = 0; i < 3; i++) {
                /* Write Source Address 1 (unicast filter) */
                SK_YU_WRITE_2(sc_if, YUKON_SAL1 + i * 4,

--
t-hash



Home | Main Index | Thread Index | Old Index