summaryrefslogtreecommitdiffstats
path: root/sys/net/if_atmsubr.c
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2006-06-29 19:22:05 +0000
committeryar <yar@FreeBSD.org>2006-06-29 19:22:05 +0000
commitba19b1ecd4d6f2950416c0596e5007ae8ffb5360 (patch)
tree3d6a9cdea9fbb33471c0beed7b40c5ae89e5a37c /sys/net/if_atmsubr.c
parentfb752eb168e0c0461ca9c98b0c8452c4d96ec4a7 (diff)
downloadFreeBSD-src-ba19b1ecd4d6f2950416c0596e5007ae8ffb5360.zip
FreeBSD-src-ba19b1ecd4d6f2950416c0596e5007ae8ffb5360.tar.gz
There is a consensus that ifaddr.ifa_addr should never be NULL,
except in places dealing with ifaddr creation or destruction; and in such special places incomplete ifaddrs should never be linked to system-wide data structures. Therefore we can eliminate all the superfluous checks for "ifa->ifa_addr != NULL" and get ready to the system crashing honestly instead of masking possible bugs. Suggested by: glebius, jhb, ru
Diffstat (limited to 'sys/net/if_atmsubr.c')
-rw-r--r--sys/net/if_atmsubr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/if_atmsubr.c b/sys/net/if_atmsubr.c
index 00f89d0..d3f7956 100644
--- a/sys/net/if_atmsubr.c
+++ b/sys/net/if_atmsubr.c
@@ -387,8 +387,8 @@ atm_ifattach(struct ifnet *ifp)
#elif defined(__FreeBSD__) || defined(__bsdi__)
for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
#endif
- if ((sdl = (struct sockaddr_dl *)ifa->ifa_addr) &&
- sdl->sdl_family == AF_LINK) {
+ if (ifa->ifa_addr->sa_family == AF_LINK) {
+ sdl = (struct sockaddr_dl *)ifa->ifa_addr;
sdl->sdl_type = IFT_ATM;
sdl->sdl_alen = ifp->if_addrlen;
#ifdef notyet /* if using ATMARP, store hardware address using the next line */
OpenPOWER on IntegriCloud