diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 2001-10-31 16:08:49 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2001-10-31 16:08:49 +0000 |
commit | 84ef95bd6ed34d385ac3c377eecaf7e0ba8e036e (patch) | |
tree | 1868a90bdd12a3a65a8690c6b136f7107c5448d1 /sbin/natd/natd.c | |
parent | 28dc1d2377bb8e4b39561872d2a68f6e788a6f11 (diff) | |
download | src-84ef95bd6ed34d385ac3c377eecaf7e0ba8e036e.tar.gz src-84ef95bd6ed34d385ac3c377eecaf7e0ba8e036e.zip |
Do not uselessly whine in syslog about packets denied by ipfw rules.
Set 'log_ipfw_denied' option if you want the old behaviour.
PR: 30255
Submitted by: Flemming "F3" Jacobsen <fj@batmule.dk>
Reviewed by: phk
MFC after: 4 weeks
Notes
Notes:
svn path=/head/; revision=85770
Diffstat (limited to 'sbin/natd/natd.c')
-rw-r--r-- | sbin/natd/natd.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/sbin/natd/natd.c b/sbin/natd/natd.c index a41d540b4bda..b5e65fc7060e 100644 --- a/sbin/natd/natd.c +++ b/sbin/natd/natd.c @@ -126,6 +126,7 @@ static int packetDirection; static int dropIgnoredIncoming; static int logDropped; static int logFacility; +static int log_ipfw_denied; int main (int argc, char** argv) { @@ -160,6 +161,7 @@ int main (int argc, char** argv) dynamicMode = 0; logDropped = 0; logFacility = LOG_DAEMON; + log_ipfw_denied = 0; /* * Mark packet buffer empty. */ @@ -614,7 +616,7 @@ static void FlushPacketBuffer (int fd) (struct ip*) packetBuf, ifMTU - aliasOverhead); } - else { + else if (errno == EACCES && log_ipfw_denied) { sprintf (msgBuf, "failed to write packet back"); Warn (msgBuf); @@ -870,7 +872,8 @@ enum Option { ProxyRule, LogDenied, LogFacility, - PunchFW + PunchFW, + LogIpfwDenied }; enum Param { @@ -1088,7 +1091,15 @@ static struct OptionInfo optionTable[] = { "basenumber:count", "punch holes in the firewall for incoming FTP/IRC DCC connections", "punch_fw", - NULL } + NULL }, + + { LogIpfwDenied, + 0, + YesNo, + "[yes|no]", + "log packets converted by natd, but denied by ipfw", + "log_ipfw_denied", + NULL }, }; static void ParseOption (const char* option, const char* parms) @@ -1272,6 +1283,8 @@ static void ParseOption (const char* option, const char* parms) case PunchFW: SetupPunchFW(strValue); break; + case LogIpfwDenied: + log_ipfw_denied=1; } } |