Convert to using if_set_sadl() instead of arc_storelladdr(), catching

an overlooked setting of ifnet->if_sadl.  This follows up the recent
change to net/if.h.
This commit is contained in:
he 2007-12-25 23:31:26 +00:00
parent 81018e0a2e
commit 32dafd4672
3 changed files with 8 additions and 21 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: smc90cx6.c,v 1.52 2007/10/19 12:00:01 ad Exp $ */
/* $NetBSD: smc90cx6.c,v 1.53 2007/12/25 23:31:27 he Exp $ */
/*-
* Copyright (c) 1994, 1995, 1998 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: smc90cx6.c,v 1.52 2007/10/19 12:00:01 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: smc90cx6.c,v 1.53 2007/12/25 23:31:27 he Exp $");
/* #define BAHSOFTCOPY */
#define BAHRETRANSMIT /**/
@ -256,7 +256,7 @@ bah_reset(sc)
struct bah_softc *sc;
{
struct ifnet *ifp;
int linkaddress;
uint8_t linkaddress;
bus_space_tag_t bst_r = sc->sc_bst_r;
bus_space_tag_t bst_m = sc->sc_bst_m;
@ -283,7 +283,7 @@ bah_reset(sc)
#endif
/* tell the routing level about the (possibly changed) link address */
arc_storelladdr(ifp, linkaddress);
if_set_sadl(ifp, &linkaddress, sizeof(linkaddress));
/* POR is NMI, but we need it below: */
sc->sc_intmask = BAH_RECON|BAH_POR;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_arc.h,v 1.20 2007/12/25 18:33:44 perry Exp $ */
/* $NetBSD: if_arc.h,v 1.21 2007/12/25 23:31:26 he Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@ -119,7 +119,6 @@ extern u_int8_t arcbroadcastaddr;
extern int arc_ipmtu; /* XXX new ip only, no RFC 1051! */
void arc_ifattach(struct ifnet *, u_int8_t);
void arc_storelladdr(struct ifnet *, u_int8_t);
char *arc_sprintf(u_int8_t *);
int arc_isphds(uint8_t);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_arcsubr.c,v 1.57 2007/10/19 12:16:44 ad Exp $ */
/* $NetBSD: if_arcsubr.c,v 1.58 2007/12/25 23:31:26 he Exp $ */
/*
* Copyright (c) 1994, 1995 Ignatios Souvatzis
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_arcsubr.c,v 1.57 2007/10/19 12:16:44 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_arcsubr.c,v 1.58 2007/12/25 23:31:26 he Exp $");
#include "opt_inet.h"
@ -616,17 +616,6 @@ arc_sprintf(uint8_t *ap)
return (arcbuf);
}
/*
* Register (new) link level address.
*/
void
arc_storelladdr(struct ifnet *ifp, uint8_t lla)
{
(void)sockaddr_dl_setaddr(ifp->if_sadl, ifp->if_sadl->sdl_len, &lla,
sizeof(lla));
ifp->if_mtu = ARC_PHDS_MAXMTU;
}
/*
* Perform common duties while attaching to interface list
*/
@ -656,8 +645,7 @@ arc_ifattach(struct ifnet *ifp, uint8_t lla)
ifp->if_xname, ifp->if_xname);
}
if_attach(ifp);
if_alloc_sadl(ifp);
arc_storelladdr(ifp, lla);
if_set_sadl(ifp, &lla, sizeof(lla));
ifp->if_broadcastaddr = &arcbroadcastaddr;