mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-08 05:34:58 +02:00
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"
This commit is contained in:
@@ -823,6 +823,7 @@ has_secret(const unsigned char *secret, unsigned int secret_len, uint32_t ipsrc,
|
|||||||
kfree(hexresult);
|
kfree(hexresult);
|
||||||
return fret;
|
return fret;
|
||||||
}
|
}
|
||||||
|
#endif /* PK_CRYPTO */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the peer pass the security policy.
|
* 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);
|
pk_debug("DENIED (anti-spoof protection)", peer);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#ifdef PK_CRYPTO
|
||||||
/* Check for OPEN secret */
|
/* Check for OPEN secret */
|
||||||
if (has_secret(info->open_secret,
|
if (has_secret(info->open_secret,
|
||||||
info->open_secret_len, peer->ip,
|
info->open_secret_len, peer->ip,
|
||||||
payload, payload_len))
|
payload, payload_len))
|
||||||
return true;
|
return true;
|
||||||
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif /* PK_CRYPTO */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates the peer and updates the peer status for an initiating or
|
* 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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PK_CRYPTO
|
|
||||||
/**
|
/**
|
||||||
* Make the peer no more ALLOWED sending a payload with a special secret for
|
* Make the peer no more ALLOWED sending a payload with a special secret for
|
||||||
* closure.
|
* closure.
|
||||||
@@ -943,6 +944,7 @@ static bool
|
|||||||
is_close_knock(const struct peer *peer, const struct xt_pknock_mtinfo *info,
|
is_close_knock(const struct peer *peer, const struct xt_pknock_mtinfo *info,
|
||||||
const unsigned char *payload, unsigned int payload_len)
|
const unsigned char *payload, unsigned int payload_len)
|
||||||
{
|
{
|
||||||
|
#ifdef PK_CRYPTO
|
||||||
/* Check for CLOSE secret. */
|
/* Check for CLOSE secret. */
|
||||||
if (has_secret(info->close_secret,
|
if (has_secret(info->close_secret,
|
||||||
info->close_secret_len, peer->ip,
|
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);
|
pk_debug("BLOCKED", peer);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif /* PK_CRYPTO */
|
|
||||||
|
|
||||||
static bool pknock_mt(const struct sk_buff *skb,
|
static bool pknock_mt(const struct sk_buff *skb,
|
||||||
const struct xt_match_param *par)
|
const struct xt_match_param *par)
|
||||||
|
Reference in New Issue
Block a user