|
@@ -4817,8 +4817,9 @@ static const struct bpf_func_proto bpf_lwt_seg6_adjust_srh_proto = {
|
|
|
};
|
|
|
#endif /* CONFIG_IPV6_SEG6_BPF */
|
|
|
|
|
|
-struct sock *sk_lookup(struct net *net, struct bpf_sock_tuple *tuple,
|
|
|
- struct sk_buff *skb, u8 family, u8 proto)
|
|
|
+#ifdef CONFIG_INET
|
|
|
+static struct sock *sk_lookup(struct net *net, struct bpf_sock_tuple *tuple,
|
|
|
+ struct sk_buff *skb, u8 family, u8 proto)
|
|
|
{
|
|
|
int dif = skb->dev->ifindex;
|
|
|
bool refcounted = false;
|
|
@@ -4951,6 +4952,7 @@ static const struct bpf_func_proto bpf_sk_release_proto = {
|
|
|
.ret_type = RET_INTEGER,
|
|
|
.arg1_type = ARG_PTR_TO_SOCKET,
|
|
|
};
|
|
|
+#endif /* CONFIG_INET */
|
|
|
|
|
|
bool bpf_helper_changes_pkt_data(void *func)
|
|
|
{
|
|
@@ -5158,12 +5160,14 @@ tc_cls_act_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
|
|
|
case BPF_FUNC_skb_ancestor_cgroup_id:
|
|
|
return &bpf_skb_ancestor_cgroup_id_proto;
|
|
|
#endif
|
|
|
+#ifdef CONFIG_INET
|
|
|
case BPF_FUNC_sk_lookup_tcp:
|
|
|
return &bpf_sk_lookup_tcp_proto;
|
|
|
case BPF_FUNC_sk_lookup_udp:
|
|
|
return &bpf_sk_lookup_udp_proto;
|
|
|
case BPF_FUNC_sk_release:
|
|
|
return &bpf_sk_release_proto;
|
|
|
+#endif
|
|
|
default:
|
|
|
return bpf_base_func_proto(func_id);
|
|
|
}
|
|
@@ -5264,12 +5268,14 @@ sk_skb_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
|
|
|
return &bpf_sk_redirect_hash_proto;
|
|
|
case BPF_FUNC_get_local_storage:
|
|
|
return &bpf_get_local_storage_proto;
|
|
|
+#ifdef CONFIG_INET
|
|
|
case BPF_FUNC_sk_lookup_tcp:
|
|
|
return &bpf_sk_lookup_tcp_proto;
|
|
|
case BPF_FUNC_sk_lookup_udp:
|
|
|
return &bpf_sk_lookup_udp_proto;
|
|
|
case BPF_FUNC_sk_release:
|
|
|
return &bpf_sk_release_proto;
|
|
|
+#endif
|
|
|
default:
|
|
|
return bpf_base_func_proto(func_id);
|
|
|
}
|