tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: RemoteIpValve lacking default 172.16/12
Date Tue, 06 Nov 2012 19:03:32 GMT
2012/11/3 Christopher Schultz <chris@christopherschultz.net>:
>
> I was looking at the Javadoc for RemoteIpValve's internalProxies
> attribute and I saw this comment:
>
> "
> 172.16/12 has not been enabled by default because it is complex to
> describe with regular expressions.
> "
>
> I'm not sure that is true. This regex ought to do it:
>
> 172\.(1[6-9]|2(5[0-5]|[6-9])|[3-9][0-9])\.\d+\.\d+
>
> Any takers?
>

That "2(5".. part is strange and wrong. What you are trying to do with it?

According to Wikipedia [1], the range is
172.16.0.0 - 172.31.255.255

So maybe  172\.(1[6-9])|(2\d)|(3[01])\.\d\d?\d?\.\d\d?\d?

That will be 16-19, 20-29, 30-31 for the second byte.

(I'd be better to have some unit tests, to be sure).

[1] http://en.wikipedia.org/wiki/Private_network#Private_IPv4_address_spaces

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message