kern/143653: ipfw nat redirect_port "buf is too small" error
Dmitriy Demidov
dima_bsd at inbox.lv
Sun Feb 7 19:40:03 UTC 2010
>Number: 143653
>Category: kern
>Synopsis: ipfw nat redirect_port "buf is too small" error
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Feb 07 19:40:02 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator: Dmitriy Demidov
>Release: 7.2-STABLE
>Organization:
>Environment:
FreeBSD hius.local.home 7.2-STABLE FreeBSD 7.2-STABLE #0: Sat Aug 15 13:49:47 EEST 2009 terminus at hius.local.home:/usr/obj/usr/src/sys/STABLE i386
>Description:
There is one bug with ipfw nat - it can not handle redirect_port configuration what consist of big number of redirect_port rules. For example if I make a try to apply this configuration:
ipfw nat 1 config if em0 log deny_in same_ports reset redirect_port tcp 127.0.0.1:28011 28011 redirect_port udp 127.0.0.1:4444 4444 redirect_port tcp 127.0.0.1:6881 6881 redirect_port udp 127.0.0.1:14400 14400 redirect_port tcp 127.0.0.1:14400 14400 redirect_port tcp 127.0.0.1:14401 14401 redirect_port tcp 127.0.0.1:14402 14402 redirect_port tcp 127.0.0.1:14403 14403 redirect_port tcp 127.0.0.1:14404 14404 redirect_port tcp 127.0.0.1:14405 14405 redirect_port tcp 127.0.0.1:14406 14406 redirect_port tcp 127.0.0.1:14407 14407 redirect_port tcp 127.0.0.1:14408 14408 redirect_port tcp 127.0.0.1:14410 14410 redirect_port tcp 127.0.0.1:14411 14411 redirect_port tcp 127.0.0.1:14412 14412 redirect_port tcp 127.0.0.1:14413 14413 redirect_port tcp 127.0.0.1:14414 14414 redirect_port tcp 127.0.0.1:14415 14415 redirect_port tcp 127.0.0.1:14416 14416 redirect_port tcp 127.0.0.1:14417 14417 redirect_port tcp 127.0.0.1:14418 14418 redirect_port tcp 127.0.0.1:14419 14419 redirect_port tcp 12
7.0.0.1:14420 14420
I always got error message:
ipfw: redirect_port: buf is too small
This problem is observed on FreeBSD 8.0-RELEASE as well.
>How-To-Repeat:
Try to configure an instance of ipfw nat with big amount of redirect_port directives.
>Fix:
It is not my solution (I found it in the Net).
====
1) edit /usr/src/sys/netinet/ip_fw.h
#define NAT_BUF_LEN 1024
change this string to something bigger
#define NAT_BUF_LEN 11264
2)
cd /usr/src/include
make install
3)
cd /usr/src
make buildworld && make buildkernel
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list