[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56D48DCE.3090705@stressinduktion.org>
Date: Mon, 29 Feb 2016 19:28:30 +0100
From: Hannes Frederic Sowa <hannes@...essinduktion.org>
To: Benjamin Poirier <bpoirier@...e.com>
Cc: Daniel Borkmann <daniel@...earbox.net>, netdev@...r.kernel.org,
Eric Dumazet <eric.dumazet@...il.com>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>
Subject: Re: [PATCH] mld, igmp: Fix reserved tailroom calculation
On 29.02.2016 19:08, Benjamin Poirier wrote:
> If you think we should write the expression with "if" instead of "min",
> instead of the current
>
> + skb->reserved_tailroom = skb_tailroom(skb) -
> + min_t(int, mtu, skb_tailroom(skb) - tlen);
>
> it should be:
>
> + if (mtu < skb_tailroom(skb) - tlen)
> + skb->reserved_tailroom = skb_tailroom(skb) - mtu;
> + else
> + skb->reserved_tailroom = tlen;
>
> The second alternative does not look more readable to me but I have been
> looking at that expression for a while. If you think that it is more
> readable, I will resend the patch expressed that way. Please let me
> know.
I would still find it more readable actually, but no strong opinion, I
would leave it up to you.
Could it make sense to put this code into a static inline helper and
reuse it for both, igmp and mld?
Thanks,
Hannes
Powered by blists - more mailing lists