Skip to contentSkip to conversation

bpf: fix bpf_setsockopts return value

PATCH Applied Yuchung Cheng 4 participants 4 messages Aug 24, 2017 – Aug 25, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf: fix bpf_setsockopts return value

This patch fixes a bug causing any sock operations to always return EINVAL.

Fixes a5192c52377e ("bpf: fix to bpf_setsockops").
---
 net/core/filter.c | 1 -
 1 file changed, 1 deletion(-)
net/core/filter.c +0 -1
index 6280a602604c..8eb81e5fae08 100644
@@ -2872,7 +2872,6 @@ BPF_CALL_5(bpf_setsockopt, struct bpf_sock_ops_kern *, bpf_sock,
 				ret = -EINVAL;
 			}
 		}
-		ret = -EINVAL;
 #endif
 	} else {
 		ret = -EINVAL;
Signature · 1 line
2.14.1.342.g6490525c54-goog
Acked-by Daniel Borkmann Acked-by
#2 lore raw

On 8/24/17, 4:37 PM, "Daniel Borkmann" <[email protected]> wrote:

On 08/25/2017 12:48 AM, Yuchung Cheng wrote:
> This patch fixes a bug causing any sock operations to always return EINVAL. >
> Fixes: a5192c52377e ("bpf: fix to bpf_setsockops").
> Reported-by: Neal Cardwell <[email protected]>
> Signed-off-by: Yuchung Cheng <[email protected]>
> Acked-by: Neal Cardwell <[email protected]>
> Acked-by: Craig Gallek <[email protected]>

Ohh well, thanks for the fix!

Thanks! I never checked return values in by bpf test programs