: Cleanup routines for feature negotiation
PATCH 8/11 : Cleanup routines for feature negotiation
[DCCP]: Cleanup routines for feature negotiation
This inserts the required de-allocation routines for memory allocated by feature negotiation in the socket destructors.
Signed-off-by Gerrit Renker <[email protected]>
--- net/dccp/dccp.h | 2 ++ net/dccp/ipv4.c | 1 + net/dccp/ipv6.c | 1 + net/dccp/proto.c | 1 + 4 files changed, 5 insertions(+)
net/dccp/dccp.h +2 -0
@@ -422,6 +422,8 @@ static inline int dccp_ack_pending(constinet_csk_ack_scheduled (sk); } +extern void dccp_feat_list_purge (struct list_head *fn_list); +extern int dccp_insert_options (struct sock *sk,struct sk_buff *skb);extern int dccp_insert_options_rsk (struct dccp_request_sock *,struct sk_buff *); extern int dccp_insert_option_elapsed_time(struct sock *sk,
net/dccp/ipv4.c +1 -0
@@ -553,6 +553,7 @@ static void dccp_v4_reqsk_destructor(str {struct dccp_request_sock *dreq =dccp_rsk (req); +dccp_feat_list_purge (&dreq->dreq_featneg);if (dreq->dreq_tstamp !=NULL )kfree (dreq->dreq_tstamp);kfree (inet_rsk (req)->opt);
net/dccp/ipv6.c +1 -0
@@ -297,6 +297,7 @@ static void dccp_v6_reqsk_destructor(str {struct dccp_request_sock *dreq =dccp_rsk (req); +dccp_feat_list_purge (&dreq->dreq_featneg);if (dreq->dreq_tstamp !=NULL )kfree (dreq->dreq_tstamp);if (inet6_rsk (req)->pktopts !=NULL )
net/dccp/proto.c +1 -0
@@ -270,6 +270,7 @@ int dccp_destroy_sock(struct sock *sk)/* clean up feature negotiation state */ dccp_feat_clean (dmsk); +dccp_feat_list_purge (&dp->dccps_featneg);return 0 ; }