summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_input.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2018-05-21 15:52:23 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2018-05-21 15:52:23 +0000
commitfd2efbb43bbf7605aaab6ed706f20ee85b72be38 (patch)
tree6265a79e358b97c76678c904ee22605554b642dc /sys/netinet/ip_input.c
parent8a6684e984808fcaa2f734eb4f48d9304a3f6094 (diff)
All places that call carp_lsdrop() use the interface pointer already.
It does not make sense to call if_get() again, just pass ifp as parameter. Move the IFT_CARP check into the function instead of doing it everywhere. Replace the inverted match variable logic with simple returns. OK mpi@ friehm@
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r--sys/netinet/ip_input.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index b3aa0318c8f..d02d5bed158 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_input.c,v 1.336 2017/12/29 17:05:25 bluhm Exp $ */
+/* $OpenBSD: ip_input.c,v 1.337 2018/05/21 15:52:22 bluhm Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
@@ -341,9 +341,8 @@ ip_input_if(struct mbuf **mp, int *offp, int nxt, int af, struct ifnet *ifp)
}
#if NCARP > 0
- if (ifp->if_type == IFT_CARP &&
- carp_lsdrop(m, AF_INET, &ip->ip_src.s_addr, &ip->ip_dst.s_addr,
- (ip->ip_p == IPPROTO_ICMP ? 0 : 1)))
+ if (carp_lsdrop(ifp, m, AF_INET, &ip->ip_src.s_addr,
+ &ip->ip_dst.s_addr, (ip->ip_p == IPPROTO_ICMP ? 0 : 1)))
goto bad;
#endif
@@ -451,8 +450,9 @@ ip_input_if(struct mbuf **mp, int *offp, int nxt, int af, struct ifnet *ifp)
}
#if NCARP > 0
- if (ifp->if_type == IFT_CARP && ip->ip_p == IPPROTO_ICMP &&
- carp_lsdrop(m, AF_INET, &ip->ip_src.s_addr, &ip->ip_dst.s_addr, 1))
+ if (ip->ip_p == IPPROTO_ICMP &&
+ carp_lsdrop(ifp, m, AF_INET, &ip->ip_src.s_addr,
+ &ip->ip_dst.s_addr, 1))
goto bad;
#endif
/*