[sr-dev] 'address' table and composite UNIQUE key for 'ip_addr' and 'mask' columns

Iñaki Baz Castillo ibc at aliax.net
Thu Apr 15 12:51:50 CEST 2010


2010/4/15 Juha Heinanen <jh at tutpro.com>:
> Juha Heinanen writes:
>
>  > i think that grp should also be included in the unique key.
>
> as well as port, but things get tricky, since port can be 0 that matched
> all ports.

I assume that in case two entries share the same ip_addr but different
mask, then the match would be priorized to the entry with greatest
mask value, am I right? This is:

1)  1.2.3.0 / 24
2)  1.2.3.4 / 32

If the source IP is 1.2.3.4 then I expect permissions module to
retrieve the second entry (as it mask value is the greatest one of all
the entries matching the source IP).


Same could be done with the port: If two entries share the same
ip_addr and mask, then that with port != 0 would have priority. Does
it make sense?



-- 
Iñaki Baz Castillo
<ibc at aliax.net>



More information about the sr-dev mailing list