From 16e49683434d4b9a638bae7df0674e61cbf802a0 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 19 Nov 2009 12:13:12 +0100 Subject: [PATCH] pknock: avoid compiler warnings for !PK_CRYPTO case xt_pknock.c: In function "update_peer": xt_pknock.c:890:3: warning: implicit declaration of function "pass_security" xt_pknock.c: In function "pknock_mt": xt_pknock.c:1030:5: warning: implicit declaration of function "is_close_knock" --- extensions/pknock/xt_pknock.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extensions/pknock/xt_pknock.c b/extensions/pknock/xt_pknock.c index 95afef9..842654e 100644 --- a/extensions/pknock/xt_pknock.c +++ b/extensions/pknock/xt_pknock.c @@ -823,6 +823,7 @@ has_secret(const unsigned char *secret, unsigned int secret_len, uint32_t ipsrc, kfree(hexresult); return fret; } +#endif /* PK_CRYPTO */ /** * If the peer pass the security policy. @@ -845,15 +846,16 @@ pass_security(struct peer *peer, const struct xt_pknock_mtinfo *info, pk_debug("DENIED (anti-spoof protection)", peer); return false; } +#ifdef PK_CRYPTO /* Check for OPEN secret */ if (has_secret(info->open_secret, info->open_secret_len, peer->ip, payload, payload_len)) return true; +#endif return false; } -#endif /* PK_CRYPTO */ /** * Validates the peer and updates the peer status for an initiating or @@ -928,7 +930,6 @@ update_peer(struct peer *peer, const struct xt_pknock_mtinfo *info, return false; } -#ifdef PK_CRYPTO /** * Make the peer no more ALLOWED sending a payload with a special secret for * closure. @@ -943,6 +944,7 @@ static bool is_close_knock(const struct peer *peer, const struct xt_pknock_mtinfo *info, const unsigned char *payload, unsigned int payload_len) { +#ifdef PK_CRYPTO /* Check for CLOSE secret. */ if (has_secret(info->close_secret, info->close_secret_len, peer->ip, @@ -951,9 +953,9 @@ is_close_knock(const struct peer *peer, const struct xt_pknock_mtinfo *info, pk_debug("BLOCKED", peer); return true; } +#endif return false; } -#endif /* PK_CRYPTO */ static bool pknock_mt(const struct sk_buff *skb, const struct xt_match_param *par)