Commit d5bbce33 authored by bitcoffee's avatar bitcoffee
Browse files

ipv4, bpf: Introduced to support the ULP to modify

 sockets during setopt

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I71USM



------------------------------------------------------

Currently, the ebpf program can distinguish sockets according to
the address accessed by the client, and use the ULP framework to
modify the matched sockets to delay link establishment.

Signed-off-by: default avatarbitcoffee <liuxin350@huawei.com>
parent 48b25f1c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -4837,6 +4837,13 @@ static int _bpf_setsockopt(struct sock *sk, int level, int optname,
						    TCP_CA_NAME_MAX-1));
			name[TCP_CA_NAME_MAX-1] = 0;
			ret = tcp_set_congestion_control(sk, name, false, true);
		} else if (optname == 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);
		} else {
			struct inet_connection_sock *icsk = inet_csk(sk);
			struct tcp_sock *tp = tcp_sk(sk);