[lkml]   [2015]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCHv2 net-next 2/2] net: Export IGMP/MLD message validation code
From: Linus Lüssing <>
Date: Tue, 14 Apr 2015 08:37:42 +0200

> +int skb_checksum_trimmed(struct sk_buff *skb, unsigned int transport_len,
> + __sum16(*skb_check_func)(struct sk_buff *skb),
> + struct sk_buff **skb_trimmed)
> +{

This is a really terrible interface.

It is designed in such a way that it is completely ambiguous who is
resonsible for managing the lifetimes of 'skb' and 'skb_trimmed'.

I would suggest changing this such that:

1) If you clone successfully, 'skb' is released.

2) whatever SKB ends up being used is returned as an error pointer.

3) The caller is responsible for freeing or grabbing a reference
to the skb returned.

Also, this is taking too long to finalize and we are past the openning
of the merge window so you will have to submit a fixed up version when
the net-next tree opens up for submissions as it is very strongly
closed right now.


 \ /
  Last update: 2015-04-14 20:41    [W:0.086 / U:4.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site