lkml.org 
[lkml]   [2023]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH net-next 02/17] Allocate and free cork for ipv4 and ipv6
This allocates the cork for ipv4, and frees it for both ipv4 and ipv6
(ipv6 inet_cork_full is allocated in a different function)

Signed-off-by: Oliver Crumrine <ozlinuxc@gmail.com>
---
net/ipv4/af_inet.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 2713c9b06c4c..3edfd8737715 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -362,6 +362,7 @@ static int inet_create(struct net *net, struct socket *sock, int protocol,
inet->mc_index = 0;
inet->mc_list = NULL;
inet->rcv_tos = 0;
+ inet->cork = kzalloc(sizeof(struct inet_cork_full), GFP_KERNEL);

if (inet->inet_num) {
/* It assumes that any protocol which allows
@@ -431,6 +432,7 @@ int inet_release(struct socket *sock)
!(current->flags & PF_EXITING))
timeout = sk->sk_lingertime;
sk->sk_prot->close(sk, timeout);
+ kfree(inet_sk(sk)->cork);
sock->sk = NULL;
}
return 0;
--
2.42.0
\
 
 \ /
  Last update: 2023-10-22 18:22    [W:0.096 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site