summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/net/if_bridge.c6
-rw-r--r--sys/netinet/ip_carp.c12
-rw-r--r--sys/netinet/ip_carp.h4
3 files changed, 8 insertions, 14 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index d62ba1b4712..0420fb98f08 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.c,v 1.198 2012/10/06 18:44:47 camield Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.199 2012/10/08 18:48:25 camield Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -1430,7 +1430,7 @@ bridge_input(struct ifnet *ifp, struct ether_header *eh, struct mbuf *m)
if (bcmp(ac->ac_enaddr, eh->ether_dhost, ETHER_ADDR_LEN) == 0
#if NCARP > 0
|| (ifl->ifp->if_carp && carp_ourether(ifl->ifp->if_carp,
- eh, 0) != NULL)
+ (u_int8_t *)&eh->ether_dhost) != NULL)
#endif
) {
if (srcifl->bif_flags & IFBIF_LEARNING)
@@ -1471,7 +1471,7 @@ bridge_input(struct ifnet *ifp, struct ether_header *eh, struct mbuf *m)
if (bcmp(ac->ac_enaddr, eh->ether_shost, ETHER_ADDR_LEN) == 0
#if NCARP > 0
|| (ifl->ifp->if_carp && carp_ourether(ifl->ifp->if_carp,
- eh, 1) != NULL)
+ (u_int8_t *)&eh->ether_shost) != NULL)
#endif
) {
m_freem(m);
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index c35645e9151..81cb3eba4c2 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.197 2012/09/19 16:14:01 blambert Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.198 2012/10/08 18:48:25 camield Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -1508,16 +1508,10 @@ carp_iamatch6(struct ifnet *ifp, u_char *src, struct sockaddr_dl **sdl)
#endif /* INET6 */
struct ifnet *
-carp_ourether(void *v, struct ether_header *eh, int src)
+carp_ourether(void *v, u_int8_t *ena)
{
struct carp_if *cif = (struct carp_if *)v;
struct carp_softc *vh;
- u_int8_t *ena;
-
- if (src)
- ena = (u_int8_t *)&eh->ether_shost;
- else
- ena = (u_int8_t *)&eh->ether_dhost;
TAILQ_FOREACH(vh, &cif->vhif_vrs, sc_list) {
struct carp_vhost_entry *vhe;
@@ -1579,7 +1573,7 @@ carp_input(struct mbuf *m, u_int8_t *shost, u_int8_t *dhost, u_int16_t etype)
bcopy(dhost, &eh.ether_dhost, sizeof(eh.ether_dhost));
eh.ether_type = etype;
- if ((ifp = carp_ourether(cif, &eh, 0)))
+ if ((ifp = carp_ourether(cif, dhost)))
;
else if (m->m_flags & (M_BCAST|M_MCAST)) {
struct carp_softc *vh;
diff --git a/sys/netinet/ip_carp.h b/sys/netinet/ip_carp.h
index 57155e2313c..7e791ae43b5 100644
--- a/sys/netinet/ip_carp.h
+++ b/sys/netinet/ip_carp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.h,v 1.28 2010/04/25 17:38:53 mpf Exp $ */
+/* $OpenBSD: ip_carp.h,v 1.29 2012/10/08 18:48:25 camield Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -171,7 +171,7 @@ int carp6_proto_input(struct mbuf **, int *, int);
int carp_iamatch(struct in_ifaddr *, u_char *, u_int8_t **,
u_int8_t **);
int carp_iamatch6(struct ifnet *, u_char *, struct sockaddr_dl **);
-struct ifnet *carp_ourether(void *, struct ether_header *, int);
+struct ifnet *carp_ourether(void *, u_int8_t *);
int carp_input(struct mbuf *, u_int8_t *, u_int8_t *, u_int16_t);
int carp_output(struct ifnet *, struct mbuf *, struct sockaddr *,
struct rtentry *);