Skip to contentSkip to conversation

bpf: fix to bpf_setsockops

PATCH Applied Lawrence Brakmo 2 participants 2 messages Jul 2, 2017

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

PATCH 1/1 bpf: fix to bpf_setsockops

Fixed build error due to misplaced "#ifdef CONFIG_INET" (moved 1 statement up).

---
 net/core/filter.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/core/filter.c +1 -2
index 523b91d..e5c280a 100644
@@ -2717,9 +2717,9 @@ BPF_CALL_5(bpf_setsockopt, struct bpf_sock_ops_kern *, bpf_sock,
 		default:
 			ret = -EINVAL;
 		}
+#ifdef CONFIG_INET
 	} else if (level == SOL_TCP &&
 		   sk->sk_prot->setsockopt == tcp_setsockopt) {
-#ifdef CONFIG_INET
 		if (optname == TCP_CONGESTION) {
 			char name[TCP_CA_NAME_MAX];
 
@@ -2757,7 +2757,6 @@ BPF_CALL_5(bpf_setsockopt, struct bpf_sock_ops_kern *, bpf_sock,
 				ret = -EINVAL;
 			}
 		}
-#else
 		ret = -EINVAL;
 #endif
 	} else {
Signature · 1 line
2.9.3