@@ -2505,7 +2505,8 @@ union bpf_attr {
* **TCP_CONGESTION**, **TCP_BPF_IW**,
* **TCP_BPF_SNDCWND_CLAMP**, **TCP_SAVE_SYN**,
* **TCP_KEEPIDLE**, **TCP_KEEPINTVL**, **TCP_KEEPCNT**,
- * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**.
+ * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**,
+ * **TCP_ULP**.
* * **IPPROTO_IP**, which supports *optname* **IP_TOS**.
* * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**.
* Return
@@ -4870,6 +4870,14 @@ static int _bpf_setsockopt(struct sock *sk, int level, int optname,
name[TCP_CA_NAME_MAX-1] = 0;
return tcp_set_congestion_control(sk, name, false, true);
}
+ case TCP_ULP: {
+ char name[TCP_ULP_NAME_MAX];
+
+ strncpy(name, optval, min_t(long, optlen,
+ TCP_ULP_NAME_MAX - 1));
+ name[TCP_ULP_NAME_MAX - 1] = 0;
+ return tcp_set_ulp(sk, name);
+ }
default:
break;
}
@@ -5000,6 +5008,14 @@ static int _bpf_getsockopt(struct sock *sk, int level, int optname,
strncpy(optval, icsk->icsk_ca_ops->name, optlen);
optval[optlen - 1] = 0;
break;
+ case TCP_ULP:
+ icsk = inet_csk(sk);
+
+ if (!icsk->icsk_ulp_ops || optlen <= 1)
+ goto err_clear;
+ strncpy(optval, icsk->icsk_ulp_ops->name, optlen);
+ optval[optlen - 1] = 0;
+ break;
case TCP_SAVED_SYN:
tp = tcp_sk(sk);
@@ -2505,7 +2505,8 @@ union bpf_attr {
* **TCP_CONGESTION**, **TCP_BPF_IW**,
* **TCP_BPF_SNDCWND_CLAMP**, **TCP_SAVE_SYN**,
* **TCP_KEEPIDLE**, **TCP_KEEPINTVL**, **TCP_KEEPCNT**,
- * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**.
+ * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**,
+ * **TCP_ULP**.
* * **IPPROTO_IP**, which supports *optname* **IP_TOS**.
* * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**.
* Return