Index: ip_carp.c =================================================================== RCS file: /cvs/src/sys/netinet/ip_carp.c,v retrieving revision 1.347 diff -u -p -r1.347 ip_carp.c --- ip_carp.c 24 Jul 2020 18:17:15 -0000 1.347 +++ ip_carp.c 27 Jul 2020 05:38:51 -0000 @@ -637,6 +637,8 @@ carp_proto_input_c(struct ifnet *ifp, st } getmicrotime(&sc->sc_if.if_lastchange); + //sc->sc_if.if_ipackets++; + //sc->sc_if.if_ibytes += m->m_pkthdr.len; /* verify the CARP version. */ if (ch->carp_version != CARP_VERSION) { @@ -1136,6 +1138,8 @@ carp_send_ad(struct carp_vhost_entry *vh m->m_data -= sizeof(*ip); getmicrotime(&sc->sc_if.if_lastchange); + //sc->sc_if.if_opackets++; + //sc->sc_if.if_obytes += len; carpstat_inc(carps_opackets); error = ip_output(m, NULL, NULL, IP_RAWOUTPUT, &sc->sc_imo, @@ -1222,6 +1226,8 @@ carp_send_ad(struct carp_vhost_entry *vh m->m_data -= sizeof(*ip6); getmicrotime(&sc->sc_if.if_lastchange); + //sc->sc_if.if_opackets++; + //sc->sc_if.if_obytes += len; carpstat_inc(carps_opackets6); error = ip6_output(m, NULL, NULL, 0, &sc->sc_im6o, NULL); @@ -2259,9 +2265,28 @@ void carp_start(struct ifnet *ifp) { struct carp_softc *sc = ifp->if_softc; +<<<<<<< ip_carp.c + struct ifnet *ifp0 = sc->sc_carpdev; +======= struct ifnet *ifp0; +>>>>>>> 1.347 struct mbuf *m; +<<<<<<< ip_carp.c + if (ifp0 == NULL) { + ifq_purge(&ifp->if_snd); + return; + } + + while ((m = ifq_dequeue(&ifp->if_snd)) != NULL) + carp_transmit(sc, ifp0, m); +} + +void +carp_transmit(struct carp_softc *sc, struct ifnet *ifp0, struct mbuf *m) +{ + struct ifnet *ifp = &sc->sc_if; +======= if ((ifp0 = if_get(sc->sc_carpdevidx)) == NULL) { ifq_purge(&ifp->if_snd); return; @@ -2276,6 +2301,7 @@ void carp_transmit(struct carp_softc *sc, struct ifnet *ifp0, struct mbuf *m) { struct ifnet *ifp = &sc->sc_if; +>>>>>>> 1.347 #if NBPFILTER > 0 { @@ -2312,20 +2338,49 @@ carp_transmit(struct carp_softc *sc, str int carp_enqueue(struct ifnet *ifp, struct mbuf *m) { +<<<<<<< ip_carp.c + struct carp_softc *sc = ifp->if_softc; + struct ifnet *ifp0 = sc->sc_carpdev; + + /* no ifq_is_priq, cos hfsc on carp doesn't make sense */ +======= struct carp_softc *sc = ifp->if_softc; struct ifnet *ifp0; /* no ifq_is_priq, cos hfsc on carp doesn't make sense */ +>>>>>>> 1.347 /* * If the parent of this carp(4) got destroyed while * `m' was being processed, silently drop it. */ +<<<<<<< ip_carp.c + if (ifp0 == NULL) { +======= if ((ifp0 = if_get(sc->sc_carpdevidx)) == NULL) { +>>>>>>> 1.347 m_freem(m); return (0); } +<<<<<<< ip_carp.c + counters_pkt(ifp->if_counters, + ifc_opackets, ifc_obytes, m->m_pkthdr.len); + carp_transmit(sc, ifp0, m); + + return (0); +} + +int +carp_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa, + struct rtentry *rt) +{ + struct carp_softc *sc = ((struct carp_softc *)ifp->if_softc); + struct carp_vhost_entry *vhe; + struct srp_ref sr; + int ismaster; + +======= counters_pkt(ifp->if_counters, ifc_opackets, ifc_obytes, m->m_pkthdr.len); carp_transmit(sc, ifp0, m); @@ -2343,6 +2398,7 @@ carp_output(struct ifnet *ifp, struct mb struct srp_ref sr; int ismaster; +>>>>>>> 1.347 if (sc->cur_vhe == NULL) { vhe = SRPL_FIRST(&sr, &sc->carp_vhosts); ismaster = (vhe->state == MASTER);