[sr-dev] git:master: modules_k/nathelper: Add is_rfc1918(ip_addr) function to test ip_addr for rfc1918addresses.

Henning Westerholt henning.westerholt at 1und1.de
Mon Aug 1 13:04:47 CEST 2011


On Monday 01 August 2011, Iñaki Baz Castillo wrote:
> 2011/8/1 Henning Westerholt <henning.westerholt at 1und1.de>:
> > i saw that you just commited it. Does the new function does implement the
> > same functionality as the one in nathelper?
> 
> Basically yes, it allows passing an string or pv and returns true if
> the given IP is a private IP according to RFC 1918.
> 
> I think it's useful to also have this function in ipops module as no
> all the deployments require nathelper features, but of course maybe
> other people don't think the same.

Hi Iñaki,

ok, understand. I think we should not introduce two functions with similar 
names and the same behaviour in two modules. Even worse, both use different 
implementations (table matching vs. ragel parser). So one commit should be 
reverted.

A generic is_rfc1918 function in ipops would be nice, but the nathelper module 
also needs this test internally. What about move one of the parsers to the 
library dir, and then just including it from both modules?

Best regards,

Henning



More information about the sr-dev mailing list