aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if_iso88025subr.c
diff options
context:
space:
mode:
authorMatthew N. Dodd <mdodd@FreeBSD.org>2003-03-15 22:52:23 +0000
committerMatthew N. Dodd <mdodd@FreeBSD.org>2003-03-15 22:52:23 +0000
commit089b2f2eade92beedc0c095619e1d0cffb3e759f (patch)
treef27f662c9dbef2a33b267a27559de1c6a33dc84d /sys/net/if_iso88025subr.c
parent69ed2746347003dcc1e6b3c3d033e75d5f731eda (diff)
downloadsrc-089b2f2eade92beedc0c095619e1d0cffb3e759f.tar.gz
src-089b2f2eade92beedc0c095619e1d0cffb3e759f.zip
iso88025_ifattach() changes:
- Call if_attach(). - Conditionally call bpfattach() based on second function argument.
Notes
Notes: svn path=/head/; revision=112297
Diffstat (limited to 'sys/net/if_iso88025subr.c')
-rw-r--r--sys/net/if_iso88025subr.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c
index 5b3f821f5417..3593ec63b453 100644
--- a/sys/net/if_iso88025subr.c
+++ b/sys/net/if_iso88025subr.c
@@ -88,8 +88,11 @@ static int iso88025_resolvemulti (struct ifnet *, struct sockaddr **,
#define IFP2AC(IFP) ((struct arpcom *)IFP)
#define senderr(e) do { error = (e); goto bad; } while (0)
+/*
+ * Perform common duties while attaching to interface list
+ */
void
-iso88025_ifattach(struct ifnet *ifp)
+iso88025_ifattach(struct ifnet *ifp, int bpf)
{
struct ifaddr *ifa;
struct sockaddr_dl *sdl;
@@ -99,21 +102,34 @@ iso88025_ifattach(struct ifnet *ifp)
ifp->if_type = IFT_ISO88025;
ifp->if_addrlen = ISO88025_ADDR_LEN;
ifp->if_hdrlen = ISO88025_HDR_LEN;
+
+ if_attach(ifp); /* Must be called before additional assignments */
+
+ ifp->if_output = iso88025_output;
+ ifp->if_input = iso88025_input;
+ ifp->if_resolvemulti = iso88025_resolvemulti;
+ ifp->if_broadcastaddr = iso88025_broadcastaddr;
+
if (ifp->if_baudrate == 0)
ifp->if_baudrate = TR_16MBPS; /* 16Mbit should be a safe default */
if (ifp->if_mtu == 0)
ifp->if_mtu = ISO88025_DEFAULT_MTU;
- ifp->if_broadcastaddr = iso88025_broadcastaddr;
ifa = ifaddr_byindex(ifp->if_index);
if (ifa == 0) {
printf("iso88025_ifattach: no lladdr!\n");
return;
}
+
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
sdl->sdl_type = IFT_ISO88025;
sdl->sdl_alen = ifp->if_addrlen;
bcopy(IFP2AC(ifp)->ac_enaddr, LLADDR(sdl), ifp->if_addrlen);
+
+ if (bpf)
+ bpfattach(ifp, DLT_IEEE802, ISO88025_HDR_LEN);
+
+ return;
}
/*