summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Eitzenberger <heitzenberger@astaro.com>2009-10-09 13:38:19 +0200
committerHarald Welte <laforge@gnumonks.org>2010-10-21 19:15:37 +0200
commit7b8e6d5bf4e951bcaf2a0c04ddfc234578fb7156 (patch)
treeafcf329dc82a05b000256cc89c2f1c3b2bccc0a0
parent52c828ccf7d647f04bf3722f00977248bf49acc5 (diff)
Improve key_reset()
Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
-rw-r--r--src/plugin.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/plugin.c b/src/plugin.c
index aecc12f..28ddc93 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -1201,18 +1201,14 @@ key_free(struct ulogd_key *key)
void
key_reset(struct ulogd_key *key)
{
- enum ulogd_ktype type;
-
if (!(key->flags & ULOGD_RETF_VALID))
return;
if (key->flags & ULOGD_RETF_FREE)
key_free(key);
- type = key->val.type;
- memset(&key->val, 0, sizeof(key->val));
- key->val.type = type;
-
+ /* use in6, because this happens to be the largest type */
+ memset(&key->val.in6, 0, sizeof(key->val.in6));
key->flags &= ~ULOGD_RETF_VALID;
}