summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2026-06-02 15:51:38 +0300
committerJakub Kicinski <kuba@kernel.org>2026-06-04 05:04:40 +0300
commita02a765bd5c2ae7705144829b2911c96c29db6ba (patch)
treeac4c71c963ab9ba548dc710512bb5e639a89dc87 /include
parent3070d0294e12311d304610703b3e691b70217549 (diff)
downloadlinux-a02a765bd5c2ae7705144829b2911c96c29db6ba.tar.xz
mptcp: change mptcp_established_options() to return opt_size
Instead of passing opt_size address to mptcp_established_options(), change this function to return it by value. This removes the need for an expensive stack canary in tcp_established_options() when CONFIG_STACKPROTECTOR_STRONG=y. $ scripts/bloat-o-meter -t vmlinux.old vmlinux.new add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-92 (-92) Function old new delta tcp_options_write.isra 1423 1407 -16 mptcp_established_options 2746 2720 -26 tcp_established_options 553 503 -50 Total: Before=22110750, After=22110658, chg -0.00% Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Link: https://patch.msgid.link/20260602125138.2317015-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/mptcp.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/include/net/mptcp.h b/include/net/mptcp.h
index f7263fe2a2e4..27225c68a388 100644
--- a/include/net/mptcp.h
+++ b/include/net/mptcp.h
@@ -149,9 +149,9 @@ bool mptcp_syn_options(struct sock *sk, const struct sk_buff *skb,
unsigned int *size, struct mptcp_out_options *opts);
bool mptcp_synack_options(const struct request_sock *req, unsigned int *size,
struct mptcp_out_options *opts);
-bool mptcp_established_options(struct sock *sk, struct sk_buff *skb,
- unsigned int *size, unsigned int remaining,
- struct mptcp_out_options *opts);
+int mptcp_established_options(struct sock *sk, struct sk_buff *skb,
+ unsigned int remaining,
+ struct mptcp_out_options *opts);
bool mptcp_incoming_options(struct sock *sk, struct sk_buff *skb);
void mptcp_write_options(struct tcphdr *th, __be32 *ptr, struct tcp_sock *tp,
@@ -266,13 +266,12 @@ static inline bool mptcp_synack_options(const struct request_sock *req,
return false;
}
-static inline bool mptcp_established_options(struct sock *sk,
- struct sk_buff *skb,
- unsigned int *size,
- unsigned int remaining,
- struct mptcp_out_options *opts)
+static inline int mptcp_established_options(struct sock *sk,
+ struct sk_buff *skb,
+ unsigned int remaining,
+ struct mptcp_out_options *opts)
{
- return false;
+ return -1;
}
static inline bool mptcp_incoming_options(struct sock *sk,