FreeBSD Bugzilla – Attachment 156929 Details for
Bug 200321
[ip] [pf] pfSync generates demotion events to carp when not needed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Prevent pfsync/carp demotions when value is 0
pfsync_demotions.diff (text/plain), 2.51 KB, created by
Ermal Luçi
on 2015-05-19 08:36:03 UTC
(
hide
)
Description:
Prevent pfsync/carp demotions when value is 0
Filename:
MIME Type:
Creator:
Ermal Luçi
Created:
2015-05-19 08:36:03 UTC
Size:
2.51 KB
patch
obsolete
>diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c >index 5935d04..03b29d5 100644 >--- a/sys/netinet/ip_carp.c >+++ b/sys/netinet/ip_carp.c >@@ -775,7 +775,8 @@ carp_send_ad_error(struct carp_softc *sc, int error) > char msg[sizeof(fmt) + IFNAMSIZ]; > > sprintf(msg, fmt, error, sc->sc_carpdev->if_xname); >- carp_demote_adj(V_carp_senderr_adj, msg); >+ if (V_carp_senderr_adj > 0) >+ carp_demote_adj(V_carp_senderr_adj, msg); > } > sc->sc_sendad_success = 0; > } else { >@@ -785,7 +786,8 @@ carp_send_ad_error(struct carp_softc *sc, int error) > char msg[sizeof(fmt) + IFNAMSIZ]; > > sprintf(msg, fmt, sc->sc_carpdev->if_xname); >- carp_demote_adj(-V_carp_senderr_adj, msg); >+ if (V_carp_senderr_adj > 0) >+ carp_demote_adj(-V_carp_senderr_adj, msg); > sc->sc_sendad_errors = 0; > } else > sc->sc_sendad_errors = 0; >diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c >index 90e6f8f..711efdb 100644 >--- a/sys/netpfil/pf/if_pfsync.c >+++ b/sys/netpfil/pf/if_pfsync.c >@@ -1150,7 +1147,7 @@ pfsync_in_bus(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count) > sc->sc_ureq_sent = 0; > sc->sc_bulk_tries = 0; > callout_stop(&sc->sc_bulkfail_tmo); >- if (!(sc->sc_flags & PFSYNCF_OK) && carp_demote_adj_p) >+ if (!(sc->sc_flags & PFSYNCF_OK) && carp_demote_adj_p && V_pfsync_carp_adj > 0) > (*carp_demote_adj_p)(-V_pfsync_carp_adj, > "pfsync bulk done"); > sc->sc_flags |= PFSYNCF_OK; >@@ -1401,7 +1397,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) > ip->ip_dst.s_addr = sc->sc_sync_peer.s_addr; > > /* Request a full state table update. */ >- if ((sc->sc_flags & PFSYNCF_OK) && carp_demote_adj_p) >+ if ((sc->sc_flags & PFSYNCF_OK) && carp_demote_adj_p && V_pfsync_carp_adj > 0) > (*carp_demote_adj_p)(V_pfsync_carp_adj, > "pfsync bulk start"); > sc->sc_flags &= ~PFSYNCF_OK; >@@ -1631,6 +1627,7 @@ pfsync_sendout(int schedswi) > sc->sc_ifp->if_obytes += m->m_pkthdr.len; > sc->sc_len = PFSYNC_MINPKT; > >+ /* XXX: SHould not drop voluntarily update packets! */ > if (!_IF_QFULL(&sc->sc_ifp->if_snd)) > _IF_ENQUEUE(&sc->sc_ifp->if_snd, m); > else { >@@ -2144,7 +2141,7 @@ pfsync_bulk_fail(void *arg) > sc->sc_ureq_sent = 0; > sc->sc_bulk_tries = 0; > PFSYNC_LOCK(sc); >- if (!(sc->sc_flags & PFSYNCF_OK) && carp_demote_adj_p) >+ if (!(sc->sc_flags & PFSYNCF_OK) && carp_demote_adj_p && V_pfsync_carp_adj > 0) > (*carp_demote_adj_p)(-V_pfsync_carp_adj, > "pfsync bulk fail"); > sc->sc_flags |= PFSYNCF_OK;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 200321
: 156929