skb: make drop reason booleanable

We have a number of cases where function returns drop/no drop
decision as a boolean. Now that we want to report the reason
code as well we have to pass extra output arguments.

We can make the reason code evaluate correctly as bool.

I believe we're good to reorder the reasons as they are
reported to user space as strings.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jakub Kicinski
2022-03-07 16:44:21 -08:00
committed by David S. Miller
parent 1163319993
commit 1330b6ef33
5 changed files with 35 additions and 31 deletions

View File

@@ -1674,10 +1674,11 @@ tcp_md5_do_lookup(const struct sock *sk, int l3index,
return NULL;
return __tcp_md5_do_lookup(sk, l3index, addr, family);
}
bool tcp_inbound_md5_hash(const struct sock *sk, const struct sk_buff *skb,
enum skb_drop_reason *reason,
const void *saddr, const void *daddr,
int family, int dif, int sdif);
enum skb_drop_reason
tcp_inbound_md5_hash(const struct sock *sk, const struct sk_buff *skb,
const void *saddr, const void *daddr,
int family, int dif, int sdif);
#define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_key)
@@ -1688,13 +1689,13 @@ tcp_md5_do_lookup(const struct sock *sk, int l3index,
{
return NULL;
}
static inline bool tcp_inbound_md5_hash(const struct sock *sk,
const struct sk_buff *skb,
enum skb_drop_reason *reason,
const void *saddr, const void *daddr,
int family, int dif, int sdif)
static inline enum skb_drop_reason
tcp_inbound_md5_hash(const struct sock *sk, const struct sk_buff *skb,
const void *saddr, const void *daddr,
int family, int dif, int sdif);
{
return false;
return SKB_NOT_DROPPED_YET;
}
#define tcp_twsk_md5_key(twsk) NULL
#endif