summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_fw2.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/netinet/ip_fw2.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/netinet/ip_fw2.c')
-rw-r--r--sys/netinet/ip_fw2.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c
index 5ad1eb6..64cfeeb 100644
--- a/sys/netinet/ip_fw2.c
+++ b/sys/netinet/ip_fw2.c
@@ -465,8 +465,6 @@ iface_match(struct ifnet *ifp, ipfw_insn_if *cmd)
/* XXX lock? */
TAILQ_FOREACH(ia, &ifp->if_addrhead, ifa_link) {
- if (ia->ifa_addr == NULL)
- continue;
if (ia->ifa_addr->sa_family != AF_INET)
continue;
if (cmd->p.ip.s_addr == ((struct sockaddr_in *)
@@ -575,8 +573,6 @@ search_ip6_addr_net (struct in6_addr * ip6_addr)
TAILQ_FOREACH(mdc, &ifnet, if_link)
TAILQ_FOREACH(mdc2, &mdc->if_addrlist, ifa_list) {
- if (!mdc2->ifa_addr)
- continue;
if (mdc2->ifa_addr->sa_family == AF_INET6) {
fdm = (struct in6_ifaddr *)mdc2;
copia = fdm->ia_addr.sin6_addr;
OpenPOWER on IntegriCloud