File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed
Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -451,7 +451,13 @@ func (v *Validator) isAllowedIPValue(s string) bool {
451451 }
452452 }
453453
454- if ip .IsUnspecified () || ip .IsPrivate () || ip .IsLoopback () || ip .IsLinkLocalUnicast () || ip .IsLinkLocalMulticast () {
454+ if ip .IsUnspecified () ||
455+ ip .IsPrivate () ||
456+ ip .IsLoopback () ||
457+ ip .IsLinkLocalUnicast () ||
458+ ip .IsLinkLocalMulticast () ||
459+ ip .IsMulticast () ||
460+ ip .Equal (net .IPv4bcast ) {
455461 return true
456462 }
457463
Original file line number Diff line number Diff line change @@ -215,6 +215,34 @@ func Test_parseElementValue(t *testing.T) {
215215 Type : "ip" ,
216216 },
217217 },
218+ {
219+ key : "unspecified ipv4" ,
220+ value : "0.0.0.0" ,
221+ definition : FieldDefinition {
222+ Type : "ip" ,
223+ },
224+ },
225+ {
226+ key : "ipv4 broadcast address" ,
227+ value : "255.255.255.255" ,
228+ definition : FieldDefinition {
229+ Type : "ip" ,
230+ },
231+ },
232+ {
233+ key : "ipv6 min multicast" ,
234+ value : "ff00::" ,
235+ definition : FieldDefinition {
236+ Type : "ip" ,
237+ },
238+ },
239+ {
240+ key : "ipv6 max multicast" ,
241+ value : "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" ,
242+ definition : FieldDefinition {
243+ Type : "ip" ,
244+ },
245+ },
218246 {
219247 key : "abbreviated ipv6 in allowed list with leading 0" ,
220248 value : "2a02:cf40:0add:0::1" ,
You can’t perform that action at this time.
0 commit comments