summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2003-10-20 00:43:59 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2003-10-20 00:43:59 +0000
commitf1079e405c613a7bbae0903cadb91f9442cbe024 (patch)
tree266d9f7252c104e00d8164d9d1c54ea9c0639a82 /sys
parentc77d56884d51e2aae2036cabb58836bfa54eeb66 (diff)
Fix but with setting advskew, only error if _both_ advbase and advskew are
set to 0. (ifconfig sets them one at a time) tested by david@
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_carp.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 232e0133814..5252c1b3e4c 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.2 2003/10/19 03:58:25 david Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.3 2003/10/20 00:43:58 mcbride Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -981,20 +981,17 @@ carp_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr)
sc->sc_ac.ac_enaddr[5] = sc->sc_vhid;
error--;
}
- if (carpr.carpr_advskew > 0) {
- if (carpr.carpr_advskew >= 255 || sc->sc_advskew == 0) {
+ if (carpr.carpr_advbase > 0 || carpr.carpr_advskew > 0) {
+ if (carpr.carpr_advskew >= 255) {
error = EINVAL;
break;
}
- sc->sc_advskew = carpr.carpr_advskew;
- error--;
- }
- if (carpr.carpr_advbase > 0) {
if (carpr.carpr_advbase > 255) {
error = EINVAL;
break;
}
sc->sc_advbase = carpr.carpr_advbase;
+ sc->sc_advskew = carpr.carpr_advskew;
error--;
}
bcopy(carpr.carpr_key, sc->sc_key, sizeof(sc->sc_key));