summaryrefslogtreecommitdiff
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-03-08 03:44:21 +0300
committerDavid S. Miller <davem@davemloft.net>2022-03-09 14:22:58 +0300
commit1330b6ef3313fcec577d2b020c290dc8b9f11f1a (patch)
treeaa98eca413902a3677b68f4eb215e7893b3714bd /net/ipv4/tcp_ipv4.c
parent1163319993f0abf8092d5f18fdff98096f7a3a73 (diff)
downloadlinux-1330b6ef3313fcec577d2b020c290dc8b9f11f1a.tar.xz
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>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 411357ad9757..81694a354110 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1965,9 +1965,10 @@ process:
struct sock *nsk;
sk = req->rsk_listener;
- if (unlikely(tcp_inbound_md5_hash(sk, skb, &drop_reason,
- &iph->saddr, &iph->daddr,
- AF_INET, dif, sdif))) {
+ drop_reason = tcp_inbound_md5_hash(sk, skb,
+ &iph->saddr, &iph->daddr,
+ AF_INET, dif, sdif);
+ if (unlikely(drop_reason)) {
sk_drops_add(sk, skb);
reqsk_put(req);
goto discard_it;
@@ -2041,8 +2042,9 @@ process:
goto discard_and_relse;
}
- if (tcp_inbound_md5_hash(sk, skb, &drop_reason, &iph->saddr,
- &iph->daddr, AF_INET, dif, sdif))
+ drop_reason = tcp_inbound_md5_hash(sk, skb, &iph->saddr,
+ &iph->daddr, AF_INET, dif, sdif);
+ if (drop_reason)
goto discard_and_relse;
nf_reset_ct(skb);