@@ -116,23 +116,23 @@ func parseMatch(key string, value string) (Match, error) {
116116}
117117
118118// parseClampInt calls strconv.Atoi on s, and then ensures that s is less than
119- // or equal to the integer specified by max .
120- func parseClampInt (s string , max int ) (int , error ) {
119+ // or equal to the integer specified by upper .
120+ func parseClampInt (s string , upper int ) (int , error ) {
121121 t , err := strconv .Atoi (s )
122122 if err != nil {
123123 return 0 , err
124124 }
125- if t > max {
126- return 0 , fmt .Errorf ("integer %d too large; %d > %d" , t , t , max )
125+ if t > upper {
126+ return 0 , fmt .Errorf ("integer %d too large; %d > %d" , t , t , upper )
127127 }
128128
129129 return t , nil
130130}
131131
132132// parseIntMatch parses an integer Match value from the input key and value,
133- // with a maximum possible value of max .
134- func parseIntMatch (key string , value string , max int ) (Match , error ) {
135- t , err := parseClampInt (value , max )
133+ // with a maximum possible value of upper .
134+ func parseIntMatch (key string , value string , upper int ) (Match , error ) {
135+ t , err := parseClampInt (value , upper )
136136 if err != nil {
137137 return nil , err
138138 }
@@ -176,8 +176,8 @@ func parseIntMatch(key string, value string, max int) (Match, error) {
176176}
177177
178178// parsePort parses a port or port/mask Match value from the input key and value,
179- // with a maximum possible value of max .
180- func parsePort (key string , value string , max int ) (Match , error ) {
179+ // with a maximum possible value of upper .
180+ func parsePort (key string , value string , upper int ) (Match , error ) {
181181
182182 var values []uint64
183183 //Split the string
@@ -186,7 +186,7 @@ func parsePort(key string, value string, max int) (Match, error) {
186186 //If input is just port
187187 switch len (ss ) {
188188 case 1 :
189- val , err := parseClampInt (value , max )
189+ val , err := parseClampInt (value , upper )
190190 if err != nil {
191191 return nil , err
192192 }
@@ -200,8 +200,8 @@ func parsePort(key string, value string, max int) (Match, error) {
200200 return nil , err
201201 }
202202 // Return error if val > 65536 (uint16)
203- if val > uint64 (max ) {
204- return nil , fmt .Errorf ("integer %d too large; %d > %d" , val , val , max )
203+ if val > uint64 (upper ) {
204+ return nil , fmt .Errorf ("integer %d too large; %d > %d" , val , val , upper )
205205 }
206206
207207 values = append (values , val )
0 commit comments