diff options
author | brooks <brooks@FreeBSD.org> | 2006-01-11 05:37:21 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2006-01-11 05:37:21 +0000 |
commit | a0556eccffb8402f45570797bdc0b93a8a9b6728 (patch) | |
tree | ce10ebd467006af721590c484d304ead20edcdf8 /sys/net | |
parent | b06663f584463acfeabeed8c03bfea92d7c97592 (diff) | |
download | FreeBSD-src-a0556eccffb8402f45570797bdc0b93a8a9b6728.zip FreeBSD-src-a0556eccffb8402f45570797bdc0b93a8a9b6728.tar.gz |
Get rid of the bogus IFP2FC() macro and use IFP2FWC(). IFP2FC()
attempted to cast a struct ifnet to a struct fw_com which resulted in
data corruption.
PR: kern/91307
Submitted by: Alex Semenyaka <alex at semenyaka do ru>
MFC After: 6 days
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_fwsubr.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/net/if_fwsubr.c b/sys/net/if_fwsubr.c index 3910237..4846b27 100644 --- a/sys/net/if_fwsubr.c +++ b/sys/net/if_fwsubr.c @@ -62,8 +62,6 @@ #include <netinet6/nd6.h> #endif -#define IFP2FC(IFP) ((struct fw_com *)IFP) - MALLOC_DEFINE(M_FWCOM, "fw_com", "firewire interface internals"); struct fw_hwaddr firewire_broadcastaddr = { @@ -79,7 +77,7 @@ static int firewire_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct rtentry *rt0) { - struct fw_com *fc = IFP2FC(ifp); + struct fw_com *fc = IFP2FWC(ifp); int error, type; struct rtentry *rt = NULL; struct m_tag *mtag; @@ -499,7 +497,7 @@ bad: void firewire_input(struct ifnet *ifp, struct mbuf *m, uint16_t src) { - struct fw_com *fc = IFP2FC(ifp); + struct fw_com *fc = IFP2FWC(ifp); union fw_encap *enc; int type, isr; @@ -667,7 +665,7 @@ firewire_ioctl(struct ifnet *ifp, int command, caddr_t data) struct sockaddr *sa; sa = (struct sockaddr *) & ifr->ifr_data; - bcopy(&IFP2FC(ifp)->fc_hwaddr, + bcopy(&IFP2FWC(ifp)->fc_hwaddr, (caddr_t) sa->sa_data, sizeof(struct fw_hwaddr)); } break; @@ -747,7 +745,7 @@ firewire_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa, void firewire_ifattach(struct ifnet *ifp, struct fw_hwaddr *llc) { - struct fw_com *fc = IFP2FC(ifp); + struct fw_com *fc = IFP2FWC(ifp); struct ifaddr *ifa; struct sockaddr_dl *sdl; static const char* speeds[] = { @@ -794,7 +792,7 @@ firewire_ifdetach(struct ifnet *ifp) void firewire_busreset(struct ifnet *ifp) { - struct fw_com *fc = IFP2FC(ifp); + struct fw_com *fc = IFP2FWC(ifp); struct fw_reass *r; struct mbuf *m; |