diff options
author | Camiel Dobbelaar <camield@cvs.openbsd.org> | 2012-10-08 18:48:26 +0000 |
---|---|---|
committer | Camiel Dobbelaar <camield@cvs.openbsd.org> | 2012-10-08 18:48:26 +0000 |
commit | f4c749cef82e1deae9dd0c7231799ffaaf36e47f (patch) | |
tree | 8105549b9c9de56e63ea66b15f710b2e82afa235 /sys/netinet | |
parent | 5e089a91cb1949251f5810ccdfcb64d8102ef5ea (diff) |
Make carp_ourether() shorter and more generic. Only a mac address
is really needed, instead of an ethernet header and selector.
ok mikeb henning mpf
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_carp.c | 12 | ||||
-rw-r--r-- | sys/netinet/ip_carp.h | 4 |
2 files changed, 5 insertions, 11 deletions
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 *); |