Skip to content

Commit

Permalink
PCAP_LOOP_SLEEP bug fix to 1/10th of a second
Browse files Browse the repository at this point in the history
[server] Updated PCAP_LOOP_SLEEP default to 1/10th of a second (in
microseconds).  This was supposed to be the default anyway, but C
Anthony Risinger reported a bug where fwknopd was consuming more
resources than necessary, and the cause was PCAP_LOOP_SLEEP set by
default to 1/100th of a second - this has been fixed.
  • Loading branch information
mrash committed Jul 24, 2012
1 parent 6255bff commit 5387242
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CREDITS
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ Andy Rowland
access.conf file would result in access requests that matched the second access.conf file would result in access requests that matched the second
stanza to always be treated as a replay attack. This has been fixed for stanza to always be treated as a replay attack. This has been fixed for
the fwknop-2.0.1 release. the fwknop-2.0.1 release.

C Anthony Risinger
- Caught a bug where the default PCAP_LOOP_SLEEP value was 1/100th of a
second instead of the intended default of 1/10th of a second.
15 changes: 10 additions & 5 deletions ChangeLog
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,5 @@
fwknop-2.0.1 (07//2012): fwknop-2.0.1 (07//2012):
- Bug fix where the same encryption key used for two stanzas in - [server] Bug fix where the same encryption key used for two stanzas in
the access.conf file would result in access requests that matched the the access.conf file would result in access requests that matched the
second stanza to always be treated as a replay attack. This has been second stanza to always be treated as a replay attack. This has been
fixed for the fwknop-2.0.1 release, and was reported by Andy Rowland. Now fixed for the fwknop-2.0.1 release, and was reported by Andy Rowland. Now
Expand All @@ -9,8 +9,13 @@ fwknop-2.0.1 (07//2012):
digest list right after the first access.conf stanza match, so when SPA digest list right after the first access.conf stanza match, so when SPA
packet data matched the second access.conf stanza a matching replay packet data matched the second access.conf stanza a matching replay
digest would already be there. digest would already be there.
- Added SPA message validation calls to fko decoding routines to help - [server] Updated PCAP_LOOP_SLEEP default to 1/10th of a second (in
ensure that SPA messages conform to expected values. microseconds). This was supposed to be the default anyway, but C
Anthony Risinger reported a bug where fwknopd was consuming more
resources than necessary, and the cause was PCAP_LOOP_SLEEP set by
default to 1/100th of a second - this has been fixed.
- [libfko] Added SPA message validation calls to fko decoding routines to
help ensure that SPA messages conform to expected values.
- Bug fix for PF firewalls: updated the PF anchor check to not rely on - Bug fix for PF firewalls: updated the PF anchor check to not rely on
listing the PF policy - fwknopd now uses 'pfctl -s Anchor' instead. listing the PF policy - fwknopd now uses 'pfctl -s Anchor' instead.
- [test suite] Added parsing of valgrind output to produce a listing of - [test suite] Added parsing of valgrind output to produce a listing of
Expand All @@ -20,8 +25,8 @@ fwknop-2.0.1 (07//2012):
instead of libfko.so. This fixes the existence check for libfko. instead of libfko.so. This fixes the existence check for libfko.
- [test suite] Added tests for --nat-local mode. - [test suite] Added tests for --nat-local mode.
- [client] Fixed several minor memory leaks caught by valgrind. - [client] Fixed several minor memory leaks caught by valgrind.
- Minor gcc warning fix: fko_decode.c:43:17: warning: variable ‘edata_size’ - [libfko] Minor gcc warning fix: fko_decode.c:43:17: warning: variable
set but not used [-Wunused-but-set-variable]. ‘edata_size’ set but not used [-Wunused-but-set-variable].


fwknop-2.0 (01/02/2012): fwknop-2.0 (01/02/2012):
- This is the first production release that has been completely re-written - This is the first production release that has been completely re-written
Expand Down
2 changes: 1 addition & 1 deletion server/config_init.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@


/* For integer variable range checking /* For integer variable range checking
*/ */
#define RCHK_MAX_PCAP_LOOP_SLEEP 100000 /* microseconds */ #define RCHK_MAX_PCAP_LOOP_SLEEP 10000000 /* microseconds, 10 seconds */
#define RCHK_MAX_SPA_PACKET_AGE 100000 /* seconds, can disable */ #define RCHK_MAX_SPA_PACKET_AGE 100000 /* seconds, can disable */
#define RCHK_MAX_SNIFF_BYTES 1514 #define RCHK_MAX_SNIFF_BYTES 1514
#define RCHK_MAX_TCPSERV_PORT 65535 #define RCHK_MAX_TCPSERV_PORT 65535
Expand Down
4 changes: 2 additions & 2 deletions server/fwknopd.conf
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
#PCAP_DISPATCH_COUNT 0; #PCAP_DISPATCH_COUNT 0;


# Sets the number of microseconds to passed as an argument to usleep() in # Sets the number of microseconds to passed as an argument to usleep() in
# the pcap loop. The default is 10000, or 1/10th of a second. # the pcap loop. The default is 100000 microseconds, or 1/10th of a second.
#PCAP_LOOP_SLEEP 10000; #PCAP_LOOP_SLEEP 100000;


# Allow SPA clients to request access to services through an iptables # Allow SPA clients to request access to services through an iptables
# firewall instead of just to it (i.e. access through the FWKNOP_FORWARD # firewall instead of just to it (i.e. access through the FWKNOP_FORWARD
Expand Down
2 changes: 1 addition & 1 deletion server/fwknopd_common.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
#define DEF_ENABLE_PCAP_PROMISC "N" #define DEF_ENABLE_PCAP_PROMISC "N"
#define DEF_PCAP_FILTER "udp port 62201" #define DEF_PCAP_FILTER "udp port 62201"
#define DEF_PCAP_DISPATCH_COUNT "0" #define DEF_PCAP_DISPATCH_COUNT "0"
#define DEF_PCAP_LOOP_SLEEP "10000" /* a tenth of a second */ #define DEF_PCAP_LOOP_SLEEP "100000" /* a tenth of a second (in microseconds) */
#define DEF_ENABLE_SPA_PACKET_AGING "Y" #define DEF_ENABLE_SPA_PACKET_AGING "Y"
#define DEF_MAX_SPA_PACKET_AGE "120" #define DEF_MAX_SPA_PACKET_AGE "120"
#define DEF_ENABLE_DIGEST_PERSISTENCE "Y" #define DEF_ENABLE_DIGEST_PERSISTENCE "Y"
Expand Down

0 comments on commit 5387242

Please sign in to comment.