Re: [PATCH net] packet: bail out of packet_snd() if L2 header creation fails

2015-01-11 Thread David Miller
From: Christoph Jaeger Date: Sun, 11 Jan 2015 13:01:16 -0500 > Due to a misplaced parenthesis, the expression > > (unlikely(offset) < 0), > > which expands to > > (__builtin_expect(!!(offset), 0) < 0), > > never evaluates to true. Therefore, when sending packets with >

Re: [PATCH net] packet: bail out of packet_snd() if L2 header creation fails

2015-01-11 Thread Daniel Borkmann
On 01/11/2015 07:01 PM, Christoph Jaeger wrote: Due to a misplaced parenthesis, the expression (unlikely(offset) < 0), which expands to (__builtin_expect(!!(offset), 0) < 0), never evaluates to true. Therefore, when sending packets with PF_PACKET/SOCK_DGRAM, packet_snd() does not abort

Re: [PATCH net] packet: bail out of packet_snd() if L2 header creation fails

2015-01-11 Thread Christoph Jaeger
On Sun, Jan 11, 2015 at 10:52:25AM -0800, Joe Perches wrote: > On Sun, 2015-01-11 at 13:01 -0500, Christoph Jaeger wrote: > > Due to a misplaced parenthesis, the expression > > > > (unlikely(offset) < 0), > > > > which expands to > > > > (__builtin_expect(!!(offset), 0) < 0), > > Here's

Re: [PATCH net] packet: bail out of packet_snd() if L2 header creation fails

2015-01-11 Thread Joe Perches
On Sun, 2015-01-11 at 13:01 -0500, Christoph Jaeger wrote: > Due to a misplaced parenthesis, the expression > > (unlikely(offset) < 0), > > which expands to > > (__builtin_expect(!!(offset), 0) < 0), Here's another one: drivers/platform/goldfish/goldfish_pipe.c:285: if (unlikely(bufflen)

Re: [PATCH net] packet: bail out of packet_snd() if L2 header creation fails

2015-01-11 Thread Willem de Bruijn
On Sun, Jan 11, 2015 at 1:35 PM, Eric Dumazet wrote: > On Sun, 2015-01-11 at 13:01 -0500, Christoph Jaeger wrote: >> Due to a misplaced parenthesis, the expression >> >> (unlikely(offset) < 0), >> >> which expands to >> >> (__builtin_expect(!!(offset), 0) < 0), >> >> never evaluates to true.

Re: [PATCH net] packet: bail out of packet_snd() if L2 header creation fails

2015-01-11 Thread Eric Dumazet
On Sun, 2015-01-11 at 13:01 -0500, Christoph Jaeger wrote: > Due to a misplaced parenthesis, the expression > > (unlikely(offset) < 0), > > which expands to > > (__builtin_expect(!!(offset), 0) < 0), > > never evaluates to true. Therefore, when sending packets with > PF_PACKET/SOCK_DGRAM,

[PATCH net] packet: bail out of packet_snd() if L2 header creation fails

2015-01-11 Thread Christoph Jaeger
Due to a misplaced parenthesis, the expression (unlikely(offset) < 0), which expands to (__builtin_expect(!!(offset), 0) < 0), never evaluates to true. Therefore, when sending packets with PF_PACKET/SOCK_DGRAM, packet_snd() does not abort as intended if the creation of the layer 2 header

Re: [PATCH net] packet: bail out of packet_snd() if L2 header creation fails

2015-01-11 Thread Christoph Jaeger
On Sun, Jan 11, 2015 at 10:52:25AM -0800, Joe Perches wrote: On Sun, 2015-01-11 at 13:01 -0500, Christoph Jaeger wrote: Due to a misplaced parenthesis, the expression (unlikely(offset) 0), which expands to (__builtin_expect(!!(offset), 0) 0), Here's another one:

[PATCH net] packet: bail out of packet_snd() if L2 header creation fails

2015-01-11 Thread Christoph Jaeger
Due to a misplaced parenthesis, the expression (unlikely(offset) 0), which expands to (__builtin_expect(!!(offset), 0) 0), never evaluates to true. Therefore, when sending packets with PF_PACKET/SOCK_DGRAM, packet_snd() does not abort as intended if the creation of the layer 2 header

Re: [PATCH net] packet: bail out of packet_snd() if L2 header creation fails

2015-01-11 Thread Eric Dumazet
On Sun, 2015-01-11 at 13:01 -0500, Christoph Jaeger wrote: Due to a misplaced parenthesis, the expression (unlikely(offset) 0), which expands to (__builtin_expect(!!(offset), 0) 0), never evaluates to true. Therefore, when sending packets with PF_PACKET/SOCK_DGRAM, packet_snd()

Re: [PATCH net] packet: bail out of packet_snd() if L2 header creation fails

2015-01-11 Thread Willem de Bruijn
On Sun, Jan 11, 2015 at 1:35 PM, Eric Dumazet eric.duma...@gmail.com wrote: On Sun, 2015-01-11 at 13:01 -0500, Christoph Jaeger wrote: Due to a misplaced parenthesis, the expression (unlikely(offset) 0), which expands to (__builtin_expect(!!(offset), 0) 0), never evaluates to true.

Re: [PATCH net] packet: bail out of packet_snd() if L2 header creation fails

2015-01-11 Thread Joe Perches
On Sun, 2015-01-11 at 13:01 -0500, Christoph Jaeger wrote: Due to a misplaced parenthesis, the expression (unlikely(offset) 0), which expands to (__builtin_expect(!!(offset), 0) 0), Here's another one: drivers/platform/goldfish/goldfish_pipe.c:285: if (unlikely(bufflen) == 0)

Re: [PATCH net] packet: bail out of packet_snd() if L2 header creation fails

2015-01-11 Thread Daniel Borkmann
On 01/11/2015 07:01 PM, Christoph Jaeger wrote: Due to a misplaced parenthesis, the expression (unlikely(offset) 0), which expands to (__builtin_expect(!!(offset), 0) 0), never evaluates to true. Therefore, when sending packets with PF_PACKET/SOCK_DGRAM, packet_snd() does not abort

Re: [PATCH net] packet: bail out of packet_snd() if L2 header creation fails

2015-01-11 Thread David Miller
From: Christoph Jaeger c...@linux.com Date: Sun, 11 Jan 2015 13:01:16 -0500 Due to a misplaced parenthesis, the expression (unlikely(offset) 0), which expands to (__builtin_expect(!!(offset), 0) 0), never evaluates to true. Therefore, when sending packets with