__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0

readonly NS="ns1-$(mktemp -u XXXXXX)"
readonly V0_IP4=10.10.0.11
readonly V1_IP4=10.10.0.1
readonly V0_IP6=2001:db8::11
readonly V1_IP6=2001:db8::1

ret=1

setup() {
	{
		ip netns add ${NS}

		ip link add v1 type veth peer name v0 netns ${NS}

		ip link set v1 up
		ip addr add $V1_IP4/24 dev v1
		ip addr add $V1_IP6/64 nodad dev v1
		ip -n ${NS} link set dev v0 up
		ip -n ${NS} addr add $V0_IP4/24 dev v0
		ip -n ${NS} addr add $V0_IP6/64 nodad dev v0

		# Enable XDP mode and disable checksum offload
		ethtool -K v1 gro on
		ethtool -K v1 tx-checksumming off
		ip netns exec ${NS} ethtool -K v0 gro on
		ip netns exec ${NS} ethtool -K v0 tx-checksumming off
	} > /dev/null 2>&1
}

cleanup() {
	ip link del v1 2> /dev/null
	ip netns del ${NS} 2> /dev/null
	[ "$(pidof xdp_features)" = "" ] || kill $(pidof xdp_features) 2> /dev/null
}

wait_for_dut_server() {
	while sleep 1; do
		ss -tlp | grep -q xdp_features
		[ $? -eq 0 ] && break
	done
}

test_xdp_features() {
	setup

	## XDP_PASS
	./xdp_features -f XDP_PASS -D $V1_IP6 -T $V0_IP6 v1 &
	wait_for_dut_server
	ip netns exec ${NS} ./xdp_features -t -f XDP_PASS \
					   -D $V1_IP6 -C $V1_IP6 \
					   -T $V0_IP6 v0
	[ $? -ne 0 ] && exit

	## XDP_DROP
	./xdp_features -f XDP_DROP -D ::ffff:$V1_IP4 -T ::ffff:$V0_IP4 v1 &
	wait_for_dut_server
	ip netns exec ${NS} ./xdp_features -t -f XDP_DROP \
					   -D ::ffff:$V1_IP4 \
					   -C ::ffff:$V1_IP4 \
					   -T ::ffff:$V0_IP4 v0
	[ $? -ne 0 ] && exit

	## XDP_ABORTED
	./xdp_features -f XDP_ABORTED -D $V1_IP6 -T $V0_IP6 v1 &
	wait_for_dut_server
	ip netns exec ${NS} ./xdp_features -t -f XDP_ABORTED \
					   -D $V1_IP6 -C $V1_IP6 \
					   -T $V0_IP6 v0
	[ $? -ne 0 ] && exit

	## XDP_TX
	./xdp_features -f XDP_TX -D ::ffff:$V1_IP4 -T ::ffff:$V0_IP4 v1 &
	wait_for_dut_server
	ip netns exec ${NS} ./xdp_features -t -f XDP_TX \
					   -D ::ffff:$V1_IP4 \
					   -C ::ffff:$V1_IP4 \
					   -T ::ffff:$V0_IP4 v0
	[ $? -ne 0 ] && exit

	## XDP_REDIRECT
	./xdp_features -f XDP_REDIRECT -D $V1_IP6 -T $V0_IP6 v1 &
	wait_for_dut_server
	ip netns exec ${NS} ./xdp_features -t -f XDP_REDIRECT \
					   -D $V1_IP6 -C $V1_IP6 \
					   -T $V0_IP6 v0
	[ $? -ne 0 ] && exit

	## XDP_NDO_XMIT
	./xdp_features -f XDP_NDO_XMIT -D ::ffff:$V1_IP4 -T ::ffff:$V0_IP4 v1 &
	wait_for_dut_server
	ip netns exec ${NS} ./xdp_features -t -f XDP_NDO_XMIT \
					   -D ::ffff:$V1_IP4 \
					   -C ::ffff:$V1_IP4 \
					   -T ::ffff:$V0_IP4 v0
	ret=$?
	cleanup
}

set -e
trap cleanup 2 3 6 9

test_xdp_features

exit $ret

Filemanager

Name Type Size Permission Actions
benchs Folder 0755
test_kmods Folder 0755
Makefile File 33.38 KB 0644
Makefile.docs File 2.15 KB 0644
ima_setup.sh File 3.26 KB 0755
test_bpftool.sh File 415 B 0755
test_bpftool_build.sh File 3.9 KB 0755
test_bpftool_metadata.sh File 1.63 KB 0755
test_doc_build.sh File 638 B 0755
test_ftrace.sh File 786 B 0755
test_kmod.sh File 1.46 KB 0755
test_lirc_mode2.sh File 764 B 0755
test_lwt_ip_encap.sh File 14.55 KB 0755
test_lwt_seg6local.sh File 6.11 KB 0755
test_tc_edt.sh File 2.75 KB 0755
test_tc_tunnel.sh File 7.82 KB 0755
test_tunnel.sh File 14.26 KB 0755
test_xdp_features.sh File 2.5 KB 0755
test_xdp_redirect_multi.sh File 6.18 KB 0755
test_xdp_vlan.sh File 5.89 KB 0755
test_xdp_vlan_mode_generic.sh File 186 B 0755
test_xdp_vlan_mode_native.sh File 180 B 0755
test_xdping.sh File 2.12 KB 0755
test_xsk.sh File 5.31 KB 0755
verify_sig_setup.sh File 2.73 KB 0755
vmtest.sh File 11.19 KB 0755
with_addr.sh File 1.27 KB 0755
with_tunnels.sh File 693 B 0755
xsk_prereqs.sh File 1.48 KB 0755
Filemanager