View | Details | Raw Unified | Return to bug 238580 | Differences between
and this patch

Collapse All | Expand All

(-)sbin/ifconfig/carp.c (-4 / +13 lines)
Lines 161-167 Link Here
161
{
161
{
162
162
163
	if (carpr_vhid == -1)
163
	if (carpr_vhid == -1)
164
		errx(1, "passwd requires vhid");
164
		errx(1, "pass requires vhid (must come first)");
165
165
166
	carpr_key = val;
166
	carpr_key = val;
167
}
167
}
Lines 171-179 Link Here
171
{
171
{
172
172
173
	if (carpr_vhid == -1)
173
	if (carpr_vhid == -1)
174
		errx(1, "advskew requires vhid");
174
		errx(1, "advskew requires vhid (must come first)");
175
175
176
	carpr_advskew = atoi(val);
176
	carpr_advskew = atoi(val);
177
178
	if (carpr_advskew < 0 || carpr_advskew > CARP_MAXSKEW)
179
		errx(1, "advskew must be something between 0 and %u",
180
			CARP_MAXSKEW);
181
177
}
182
}
178
183
179
static void
184
static void
Lines 181-189 Link Here
181
{
186
{
182
187
183
	if (carpr_vhid == -1)
188
	if (carpr_vhid == -1)
184
		errx(1, "advbase requires vhid");
189
		errx(1, "advbase requires vhid (must come first)");
185
190
186
	carpr_advbase = atoi(val);
191
	carpr_advbase = atoi(val);
192
193
	if (carpr_advbase < CARP_DFLTINTV || carpr_advbase > 255)
194
		errx(1, "advbase must be greater than 0 and less than 256");
195
187
}
196
}
188
197
189
static void
198
static void
Lines 192-198 Link Here
192
	int i;
201
	int i;
193
202
194
	if (carpr_vhid == -1)
203
	if (carpr_vhid == -1)
195
		errx(1, "state requires vhid");
204
		errx(1, "state requires vhid (must come first)");
196
205
197
	for (i = 0; i <= CARP_MAXSTATE; i++)
206
	for (i = 0; i <= CARP_MAXSTATE; i++)
198
		if (strcasecmp(carp_states[i], val) == 0) {
207
		if (strcasecmp(carp_states[i], val) == 0) {
(-)sbin/ifconfig/ifconfig.8 (-1 / +1 lines)
Lines 2841-2847 Link Here
2841
Specifies the skew to add to the base advertisement interval to
2841
Specifies the skew to add to the base advertisement interval to
2842
make one host advertise slower than another host.
2842
make one host advertise slower than another host.
2843
It is specified in 1/256 of seconds.
2843
It is specified in 1/256 of seconds.
2844
The acceptable values are 1 to 254.
2844
The acceptable values are 0 to 240.
2845
The default value is 0.
2845
The default value is 0.
2846
.It Cm pass Ar phrase
2846
.It Cm pass Ar phrase
2847
Set the authentication key to
2847
Set the authentication key to
(-)sys/netinet/ip_carp.c (-8 / +7 lines)
Lines 1766-1780 Link Here
1766
		} else
1766
		} else
1767
			CARP_LOCK(sc);
1767
			CARP_LOCK(sc);
1768
		locked = 1;
1768
		locked = 1;
1769
		if (carpr.carpr_advbase > 0) {
1769
		if (carpr.carpr_advbase < CARP_DFLTINTV ||
1770
			if (carpr.carpr_advbase > 255 ||
1770
		    carpr.carpr_advbase > 255) {
1771
			    carpr.carpr_advbase < CARP_DFLTINTV) {
1771
			error = EINVAL;
1772
				error = EINVAL;
1772
			break;
1773
				break;
1774
			}
1775
			sc->sc_advbase = carpr.carpr_advbase;
1776
		}
1773
		}
1777
		if (carpr.carpr_advskew >= 255) {
1774
		sc->sc_advbase = carpr.carpr_advbase;
1775
		if (carpr.carpr_advskew < 0 ||
1776
		    carpr.carpr_advskew > CARP_MAXSKEW) {
1778
			error = EINVAL;
1777
			error = EINVAL;
1779
			break;
1778
			break;
1780
		}
1779
		}

Return to bug 238580