View | Details | Raw Unified | Return to bug 200321
Collapse All | Expand All

(-)b/sys/netinet/ip_carp.c (-2 / +4 lines)
Lines 775-781 carp_send_ad_error(struct carp_softc *sc, int error) Link Here
775
			char msg[sizeof(fmt) + IFNAMSIZ];
775
			char msg[sizeof(fmt) + IFNAMSIZ];
776
776
777
			sprintf(msg, fmt, error, sc->sc_carpdev->if_xname);
777
			sprintf(msg, fmt, error, sc->sc_carpdev->if_xname);
778
			carp_demote_adj(V_carp_senderr_adj, msg);
778
			if (V_carp_senderr_adj > 0)
779
				carp_demote_adj(V_carp_senderr_adj, msg);
779
		}
780
		}
780
		sc->sc_sendad_success = 0;
781
		sc->sc_sendad_success = 0;
781
	} else {
782
	} else {
Lines 785-791 carp_send_ad_error(struct carp_softc *sc, int error) Link Here
785
			char msg[sizeof(fmt) + IFNAMSIZ];
786
			char msg[sizeof(fmt) + IFNAMSIZ];
786
787
787
			sprintf(msg, fmt, sc->sc_carpdev->if_xname);
788
			sprintf(msg, fmt, sc->sc_carpdev->if_xname);
788
			carp_demote_adj(-V_carp_senderr_adj, msg);
789
			if (V_carp_senderr_adj > 0)
790
				carp_demote_adj(-V_carp_senderr_adj, msg);
789
			sc->sc_sendad_errors = 0;
791
			sc->sc_sendad_errors = 0;
790
		} else
792
		} else
791
			sc->sc_sendad_errors = 0;
793
			sc->sc_sendad_errors = 0;
(-)b/sys/netpfil/pf/if_pfsync.c (-3 / +4 lines)
Lines 1150-1156 pfsync_in_bus(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count) Link Here
1150
			sc->sc_ureq_sent = 0;
1147
			sc->sc_ureq_sent = 0;
1151
			sc->sc_bulk_tries = 0;
1148
			sc->sc_bulk_tries = 0;
1152
			callout_stop(&sc->sc_bulkfail_tmo);
1149
			callout_stop(&sc->sc_bulkfail_tmo);
1153
			if (!(sc->sc_flags & PFSYNCF_OK) && carp_demote_adj_p)
1150
			if (!(sc->sc_flags & PFSYNCF_OK) && carp_demote_adj_p && V_pfsync_carp_adj > 0)
1154
				(*carp_demote_adj_p)(-V_pfsync_carp_adj,
1151
				(*carp_demote_adj_p)(-V_pfsync_carp_adj,
1155
				    "pfsync bulk done");
1152
				    "pfsync bulk done");
1156
			sc->sc_flags |= PFSYNCF_OK;
1153
			sc->sc_flags |= PFSYNCF_OK;
Lines 1401-1407 pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) Link Here
1401
		ip->ip_dst.s_addr = sc->sc_sync_peer.s_addr;
1397
		ip->ip_dst.s_addr = sc->sc_sync_peer.s_addr;
1402
1398
1403
		/* Request a full state table update. */
1399
		/* Request a full state table update. */
1404
		if ((sc->sc_flags & PFSYNCF_OK) && carp_demote_adj_p)
1400
		if ((sc->sc_flags & PFSYNCF_OK) && carp_demote_adj_p && V_pfsync_carp_adj > 0)
1405
			(*carp_demote_adj_p)(V_pfsync_carp_adj,
1401
			(*carp_demote_adj_p)(V_pfsync_carp_adj,
1406
			    "pfsync bulk start");
1402
			    "pfsync bulk start");
1407
		sc->sc_flags &= ~PFSYNCF_OK;
1403
		sc->sc_flags &= ~PFSYNCF_OK;
Lines 1631-1636 pfsync_sendout(int schedswi) Link Here
1631
	sc->sc_ifp->if_obytes += m->m_pkthdr.len;
1627
	sc->sc_ifp->if_obytes += m->m_pkthdr.len;
1632
	sc->sc_len = PFSYNC_MINPKT;
1628
	sc->sc_len = PFSYNC_MINPKT;
1633
1629
1630
	/* XXX: SHould not drop voluntarily update packets! */
1634
	if (!_IF_QFULL(&sc->sc_ifp->if_snd))
1631
	if (!_IF_QFULL(&sc->sc_ifp->if_snd))
1635
		_IF_ENQUEUE(&sc->sc_ifp->if_snd, m);
1632
		_IF_ENQUEUE(&sc->sc_ifp->if_snd, m);
1636
	else {
1633
	else {
Lines 2144-2150 pfsync_bulk_fail(void *arg) Link Here
2144
		sc->sc_ureq_sent = 0;
2141
		sc->sc_ureq_sent = 0;
2145
		sc->sc_bulk_tries = 0;
2142
		sc->sc_bulk_tries = 0;
2146
		PFSYNC_LOCK(sc);
2143
		PFSYNC_LOCK(sc);
2147
		if (!(sc->sc_flags & PFSYNCF_OK) && carp_demote_adj_p)
2144
		if (!(sc->sc_flags & PFSYNCF_OK) && carp_demote_adj_p && V_pfsync_carp_adj > 0)
2148
			(*carp_demote_adj_p)(-V_pfsync_carp_adj,
2145
			(*carp_demote_adj_p)(-V_pfsync_carp_adj,
2149
			    "pfsync bulk fail");
2146
			    "pfsync bulk fail");
2150
		sc->sc_flags |= PFSYNCF_OK;
2147
		sc->sc_flags |= PFSYNCF_OK;

Return to bug 200321