FreeBSD Bugzilla – Attachment 205222 Details for
Bug 238580
ifconfig(8): respect defines from 'sys/netinet/ip_carp.h'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH] respect defines from 'sys/netinet/ip_carp.h'
base_r349162__carp.diff (text/plain), 2.56 KB, created by
VinÃcius Zavam
on 2019-06-19 16:15:32 UTC
(
hide
)
Description:
[PATCH] respect defines from 'sys/netinet/ip_carp.h'
Filename:
MIME Type:
Creator:
VinÃcius Zavam
Created:
2019-06-19 16:15:32 UTC
Size:
2.56 KB
patch
obsolete
>Index: sbin/ifconfig/carp.c >=================================================================== >--- sbin/ifconfig/carp.c (revision 349162) >+++ sbin/ifconfig/carp.c (working copy) >@@ -161,7 +161,7 @@ > { > > if (carpr_vhid == -1) >- errx(1, "passwd requires vhid"); >+ errx(1, "pass requires vhid (must come first)"); > > carpr_key = val; > } >@@ -171,9 +171,14 @@ > { > > if (carpr_vhid == -1) >- errx(1, "advskew requires vhid"); >+ errx(1, "advskew requires vhid (must come first)"); > > carpr_advskew = atoi(val); >+ >+ if (carpr_advskew < 0 || carpr_advskew > CARP_MAXSKEW) >+ errx(1, "advskew must be something between 0 and %u", >+ CARP_MAXSKEW); >+ > } > > static void >@@ -181,9 +186,13 @@ > { > > if (carpr_vhid == -1) >- errx(1, "advbase requires vhid"); >+ errx(1, "advbase requires vhid (must come first)"); > > carpr_advbase = atoi(val); >+ >+ if (carpr_advbase < CARP_DFLTINTV || carpr_advbase > 255) >+ errx(1, "advbase must be greater than 0 and less than 256"); >+ > } > > static void >@@ -192,7 +201,7 @@ > int i; > > if (carpr_vhid == -1) >- errx(1, "state requires vhid"); >+ errx(1, "state requires vhid (must come first)"); > > for (i = 0; i <= CARP_MAXSTATE; i++) > if (strcasecmp(carp_states[i], val) == 0) { >Index: sbin/ifconfig/ifconfig.8 >=================================================================== >--- sbin/ifconfig/ifconfig.8 (revision 349162) >+++ sbin/ifconfig/ifconfig.8 (working copy) >@@ -2841,7 +2841,7 @@ > Specifies the skew to add to the base advertisement interval to > make one host advertise slower than another host. > It is specified in 1/256 of seconds. >-The acceptable values are 1 to 254. >+The acceptable values are 0 to 240. > The default value is 0. > .It Cm pass Ar phrase > Set the authentication key to >Index: sys/netinet/ip_carp.c >=================================================================== >--- sys/netinet/ip_carp.c (revision 349162) >+++ sys/netinet/ip_carp.c (working copy) >@@ -1,4 +1,4 @@ >-/*- >+*- > * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > * > * Copyright (c) 2002 Michael Shalayeff. >@@ -1766,15 +1766,14 @@ > } else > CARP_LOCK(sc); > locked = 1; >- if (carpr.carpr_advbase > 0) { >- if (carpr.carpr_advbase > 255 || >- carpr.carpr_advbase < CARP_DFLTINTV) { >- error = EINVAL; >- break; >- } >- sc->sc_advbase = carpr.carpr_advbase; >+ if (carpr.carpr_advbase < CARP_DFLTINTV || >+ carpr.carpr_advbase > 255) { >+ error = EINVAL; >+ break; > } >- if (carpr.carpr_advskew >= 255) { >+ sc->sc_advbase = carpr.carpr_advbase; >+ if (carpr.carpr_advskew < 0 || >+ carpr.carpr_advskew > DEMOTE_ADVSKEW(sc)) { > error = EINVAL; > break; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 238580
:
205076
|
205196
|
205197
|
205198
|
205222
|
205306