Skip to content

Commit

Permalink
dccp: Cleanup routines for feature negotiation
Browse files Browse the repository at this point in the history
This inserts the required de-allocation routines for memory allocated
by feature negotiation in the socket destructors, replacing
dccp_feat_clean() in one instance.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Gerrit Renker authored and David S. Miller committed Nov 5, 2008
1 parent ac75773 commit d99a7bd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions net/dccp/ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ static void dccp_v4_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)

static void dccp_v4_reqsk_destructor(struct request_sock *req)
{
dccp_feat_list_purge(&dccp_rsk(req)->dreq_featneg);
kfree(inet_rsk(req)->opt);
}

Expand Down
1 change: 1 addition & 0 deletions net/dccp/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req)

static void dccp_v6_reqsk_destructor(struct request_sock *req)
{
dccp_feat_list_purge(&dccp_rsk(req)->dreq_featneg);
if (inet6_rsk(req)->pktopts != NULL)
kfree_skb(inet6_rsk(req)->pktopts);
}
Expand Down
2 changes: 1 addition & 1 deletion net/dccp/proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ void dccp_destroy_sock(struct sock *sk)
dp->dccps_hc_rx_ccid = dp->dccps_hc_tx_ccid = NULL;

/* clean up feature negotiation state */
dccp_feat_clean(dmsk);
dccp_feat_list_purge(&dp->dccps_featneg);
}

EXPORT_SYMBOL_GPL(dccp_destroy_sock);
Expand Down

0 comments on commit d99a7bd

Please sign in to comment.