Page MenuHomeFreeBSD

pfsync: Add CTLFLAG_VNET to carp_demotion_factor sysctl
ClosedPublic

Authored by email_luiz.eng.br on Apr 1 2022, 7:46 PM.
Tags
None
Referenced Files
F153090624: D34737.diff
Sun, Apr 19, 1:58 AM
F153038434: D34737.id.diff
Sat, Apr 18, 6:58 PM
Unknown Object (File)
Fri, Apr 17, 5:06 AM
Unknown Object (File)
Sun, Apr 12, 12:42 AM
Unknown Object (File)
Fri, Apr 10, 3:21 AM
Unknown Object (File)
Tue, Apr 7, 8:32 PM
Unknown Object (File)
Sun, Apr 5, 4:42 PM
Unknown Object (File)
Fri, Apr 3, 2:55 PM

Details

Summary

When trying to avoid a CARP demotion during a pfsync service restart, I noticed that a non-default value for the net.pfsync.carp_demotion_factor sysctl was not being applied during the demotion. The CARP was always demoted by 240.

After investigating, I realized that the sysctl was using VNET_NAME() without the CTLFLAG_VNET.

Please inform me if something is wrong or missing with this revision/differential. This is the first time I'm creating one.

PR: 262983
Submitted by: Luiz Amaral <email@luiz.eng.br>

Test Plan

Setup pfsync between two hosts.

Go to one of the hosts and issue:

# sysctl net.pfsync.carp_demotion_factor=0
# service pfsync restart
# grep carp /var/log/messages

Check the grep output and confirm that during the pfsync bulk operation, the CARP was demoted by 0 instead of 240.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable