Skip to content

Commit 6c302e7

Browse files
edumazetdavem330
authored andcommitted
net: forward_alloc_get depends on CONFIG_MPTCP
(struct proto)->sk_forward_alloc is currently only used by MPTCP. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1ace2b4 commit 6c302e7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

include/net/sock.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,9 @@ struct proto {
12061206
unsigned int inuse_idx;
12071207
#endif
12081208

1209+
#if IS_ENABLED(CONFIG_MPTCP)
12091210
int (*forward_alloc_get)(const struct sock *sk);
1211+
#endif
12101212

12111213
bool (*stream_memory_free)(const struct sock *sk, int wake);
12121214
bool (*sock_is_readable)(struct sock *sk);
@@ -1295,10 +1297,11 @@ INDIRECT_CALLABLE_DECLARE(bool tcp_stream_memory_free(const struct sock *sk, int
12951297

12961298
static inline int sk_forward_alloc_get(const struct sock *sk)
12971299
{
1298-
if (!sk->sk_prot->forward_alloc_get)
1299-
return sk->sk_forward_alloc;
1300-
1301-
return sk->sk_prot->forward_alloc_get(sk);
1300+
#if IS_ENABLED(CONFIG_MPTCP)
1301+
if (sk->sk_prot->forward_alloc_get)
1302+
return sk->sk_prot->forward_alloc_get(sk);
1303+
#endif
1304+
return sk->sk_forward_alloc;
13021305
}
13031306

13041307
static inline bool __sk_stream_memory_free(const struct sock *sk, int wake)

0 commit comments

Comments
 (0)