summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2011-04-04 14:25:17 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2011-04-04 14:25:17 +0000
commit2bb33c4114c4c727387cf2bc01412cce35d01bb5 (patch)
tree9f7990be6fd8a3aee7762e1d7e172d623453227c /sys
parentda2e61bc25cb2737ac250d73683635a26f28aaab (diff)
install an additional bpf hook in the carp_input so that multicast
and broadcast packets will be caught too; also we need to increment the incoming packet counter as reminded by claudio. ok claudio mpf
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_carp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index ef67977f270..ee246172507 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.181 2011/03/08 22:53:28 mpf Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.182 2011/04/04 14:25:16 mikeb Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -1580,6 +1580,12 @@ carp_input(struct mbuf *m, u_int8_t *shost, u_int8_t *dhost, u_int16_t etype)
if (m0 == NULL)
continue;
m0->m_pkthdr.rcvif = &vh->sc_if;
+#if NBPFILTER > 0
+ if (vh->sc_if.if_bpf)
+ bpf_mtap_hdr(vh->sc_if.if_bpf, (char *)&eh,
+ ETHER_HDR_LEN, m0, BPF_DIRECTION_IN);
+#endif
+ vh->sc_if.if_ipackets++;
ether_input(&vh->sc_if, &eh, m0);
}
return (1);