diff options
author | Luiz Otavio O Souza <loos@FreeBSD.org> | 2015-01-06 13:07:13 +0000 |
---|---|---|
committer | Luiz Otavio O Souza <loos@FreeBSD.org> | 2015-01-06 13:07:13 +0000 |
commit | 57c5139c46144c67f1624c6f355fdef43fcfdaff (patch) | |
tree | 612ade0fd442f4d27d80fb087d0118e3c41c6ea8 /sys/netinet/ip_carp.c | |
parent | 2a8c860fe3f3bcfc6ba9206f34d067d998d89c7e (diff) | |
download | src-57c5139c46144c67f1624c6f355fdef43fcfdaff.tar.gz src-57c5139c46144c67f1624c6f355fdef43fcfdaff.zip |
Remove the check that prevent carp(4) advskew to be set to '0'.
CARP devices are created with advskew set to '0' and once you set it to
any other value in the valid range (0..254) you can't set it back to zero.
The code in question is also used to prevent that zeroed values overwrite
the CARP defaults when a new CARP device is created. Since advskew already
defaults to '0' for newly created devices and the new value is guaranteed
to be within the valid range, it is safe to overwrite it here.
PR: 194672
Reported by: cmb@pfsense.org
In collaboration with: garga
Tested by: garga
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=276751
Diffstat (limited to 'sys/netinet/ip_carp.c')
-rw-r--r-- | sys/netinet/ip_carp.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 97862733bc79..4ecc58a0dfb2 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1703,13 +1703,11 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct thread *td) } sc->sc_advbase = carpr.carpr_advbase; } - if (carpr.carpr_advskew > 0) { - if (carpr.carpr_advskew >= 255) { - error = EINVAL; - break; - } - sc->sc_advskew = carpr.carpr_advskew; + if (carpr.carpr_advskew >= 255) { + error = EINVAL; + break; } + sc->sc_advskew = carpr.carpr_advskew; if (carpr.carpr_key[0] != '\0') { bcopy(carpr.carpr_key, sc->sc_key, sizeof(sc->sc_key)); carp_hmac_prepare(sc); |