misc/80972: Destroying carp interface prevents carp from preempting
ever again
Frank Volf
frank at deze.org
Fri May 13 11:30:02 GMT 2005
>Number: 80972
>Category: misc
>Synopsis: Destroying carp interface prevents carp from preempting ever again
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri May 13 11:30:01 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Frank Volf
>Release: 5.4
>Organization:
>Environment:
>Description:
This was discussed with Gleb Smirnoff but he does not have time to fix it. Here is the mail exchange:
Frank,
good catch, thanks! I'll work on this next working day.
On Sun, May 01, 2005 at 12:05:02PM +0200, Frank wrote:
F> Hi Gleb,
F>
F> I have found a bug in CARP. The problem exits if you are using
F> preemption (net.inet.carp.preempt=1) and you destroy a carp interface
F> that is currently down.
F>
F> The counter carp_suppress_preempt counts the number of interfaces that
F> are currently down. If this counter > 0 then the system will advertise
F> with advskew 240.
F>
F> The mechanism works fine, the counter is increased when the number of
F> interfaces that is down increases, and decreases likewise. If the
F> counter is 0 again, then de advskew of 240 is no longer used and the
F> original advskew is used again.
F>
F> The problem exists in the fact that if you destroy a CARP interface that
F> is currently down, then the carp_suppress_preempt counter is never
F> compenstated for that. After such an event the carp_suppress_preempt
F> counter is always too large, and the system will use advskew forever.
F>
F> This is fixed with the following patch (copy and pasted, so may not
F> apply cleanly). It adds logic to carp_clone_destroy to decrease the
F> counter if the interface is destoyed.
F>
F> Please let me know what you think.
F>
F> Regards,
F>
F> Frank
F>
F>
F>
F> Index: ip_carp.c
F> ===================================================================
F> RCS file: /home/cvs/firewall/FreeBSD/sys-5.4/netinet/ip_carp.c,v
F> retrieving revision 1.3
F> diff -u -r1.3 ip_carp.c
F> --- ip_carp.c 26 Apr 2005 10:55:06 -0000 1.3
F> +++ ip_carp.c 1 May 2005 09:49:37 -0000
F> @@ -405,6 +405,16 @@
F>
F> /* carpdetach(sc); */
F>
F> + /*
F> + * If an interface is destroyed which is suppressing the preemption,
F> + * decrease the global counter, otherwise the host will never get
F> + * out of the carp supressing state
F> + */
F> + if (sc->sc_suppress)
F> + carp_suppress_preempt--;
F> + sc->sc_suppress = 0;
F> +
F> +
-- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE
On Fri, May 06, 2005 at 11:20:59PM +0200, Frank wrote:
F> Did you have a look at this? I think it should be committed asap so it
F> makes FreeBSD 5.4 release....
ENOTIME, sorry :(
The release tagging has already been done yesterday...
-- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE
>How-To-Repeat:
See above
>Fix:
See patch
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list