tools/testing/selftests/net/netfilter/nf_conntrack_packetdrill.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/netfilter/nf_conntrack_packetdrill.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/netfilter/nf_conntrack_packetdrill.sh- Extension
.sh- Size
- 1392 bytes
- Lines
- 72
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
source lib.sh
checktool "conntrack --version" "run test without conntrack"
checktool "iptables --version" "run test without iptables"
checktool "ip6tables --version" "run test without ip6tables"
modprobe -q tun
modprobe -q nf_conntrack
# echo 1 > /proc/sys/net/netfilter/nf_log_all_netns
PDRILL_TIMEOUT=10
files="
conntrack_ack_loss_stall.pkt
conntrack_inexact_rst.pkt
conntrack_syn_challenge_ack.pkt
conntrack_synack_old.pkt
conntrack_synack_reuse.pkt
conntrack_rst_invalid.pkt
"
if ! packetdrill --dry_run --verbose "packetdrill/conntrack_ack_loss_stall.pkt";then
echo "SKIP: packetdrill not installed"
exit ${ksft_skip}
fi
ret=0
run_packetdrill()
{
filename="$1"
ipver="$2"
local mtu=1500
export NFCT_IP_VERSION="$ipver"
if [ "$ipver" = "ipv4" ];then
export xtables="iptables"
elif [ "$ipver" = "ipv6" ];then
export xtables="ip6tables"
mtu=1520
fi
timeout "$PDRILL_TIMEOUT" unshare -n packetdrill --ip_version="$ipver" --mtu=$mtu \
--tolerance_usecs=1000000 --non_fatal packet "$filename"
}
run_one_test_file()
{
filename="$1"
for v in ipv4 ipv6;do
printf "%-50s(%s)%-20s" "$filename" "$v" ""
if run_packetdrill packetdrill/"$f" "$v";then
echo OK
else
echo FAIL
ret=1
fi
done
}
echo "Replaying packetdrill test cases:"
for f in $files;do
run_one_test_file packetdrill/"$f"
done
Annotation
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.