Skip to content

Commit

Permalink
Merge pull request #10 from NicolasLM/fix_check_future_packet
Browse files Browse the repository at this point in the history
Fix incorrect default value of check_future_packet
  • Loading branch information
mohierf committed Apr 17, 2016
2 parents bee3e26 + 574880c commit 60e5f10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_instance(plugin):
password = "dummy"

max_packet_age = min(int(getattr(plugin, 'max_packet_age', '30')), 900)
check_future_packet = bool(getattr(plugin, 'check_future_packet', 'False'))
check_future_packet = bool(getattr(plugin, 'check_future_packet', 0))

instance = NSCA_arbiter(plugin, host, port,
buffer_length, payload_length, encryption_method, password, max_packet_age, check_future_packet,
Expand Down Expand Up @@ -215,7 +215,7 @@ def process_check_result(self, databuffer, IV):
current_time = time.time()
check_result_age = current_time - timestamp
if timestamp > current_time and self.check_future_packet:
logger.info("[NSCA] Dropping packet with future timestamp.")
logger.warning("[NSCA] Dropping packet with future timestamp.")
elif check_result_age > self.max_packet_age:
logger.info(
"[NSCA] Dropping packet with stale timestamp - packet was %s seconds old. Timestamp: %s for %s/%s" % \
Expand Down

0 comments on commit 60e5f10

Please sign in to comment.