IPFW tables trouble
Alexander V. Chernikov
melifaro at FreeBSD.org
Thu May 17 06:51:25 UTC 2012
On 16.05.2012 16:07, Daniel Kalchev wrote:
> Hello,
>
> I am having an persistent problem when using tables with ipfw. On a
> number of routers, built with various FreeBSD versions, with ipfw as
> loadable module or statically compiled, the problem remains the same.
>
> From time to time, ipfw spews errors like this:
>
> Non-unique normal route, mask not entered
> Non-unique normal route, mask not entered
>
> or
>
> rn_delete: couldn't find our annotation
> rn_delete: couldn't find our annotation
> rn_delete: couldn't find our annotation
It seems that under some conditions mask is passed incorrectly to radix
code. Wrong mask can be generated by ipfw module if userland passes
value larger that 32. What is funny that kernel still doesn't check mask
value in case of IPv4.
Can you update your 9-stable, add something like the following:
Index: sys/netinet/ipfw/ip_fw_table.c
===================================================================
--- sys/netinet/ipfw/ip_fw_table.c (revision 235530)
+++ sys/netinet/ipfw/ip_fw_table.c (working copy)
@@ -153,6 +153,8 @@ ipfw_add_table_entry(struct ip_fw_chain *ch, uint1
case IPFW_TABLE_CIDR:
if (plen == sizeof(in_addr_t)) {
#ifdef INET
+ if (mlen > 32)
+ return (EINVAL);
ent = malloc(sizeof(*ent), M_IPFW_TBL, M_WAITOK
| M_ZERO);
ent->value = value;
/* Set 'total' structure length */
and see if this helps?
The same idea applies to 7/8, hence the code is still different.
>
> Sometimes, after such output, if one does:
>
> ipfw table 1 flush
> ipfw table 1 list
>
> the output is non-empty. It should be empty, right?
Can you show an examples for such output ?
How often does this happen ?
>
> This problem has troubled me for a number of years already.
>
> Thanks in advance,
> Daniel
> _______________________________________________
> freebsd-ipfw at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-ipfw
> To unsubscribe, send any mail to "freebsd-ipfw-unsubscribe at freebsd.org"
>
More information about the freebsd-ipfw
mailing list