tools/testing/selftests/net/netfilter/vxlan_mtu_frag.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/netfilter/vxlan_mtu_frag.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/netfilter/vxlan_mtu_frag.sh- Extension
.sh- Size
- 3120 bytes
- Lines
- 122
- 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
function cleanup
Annotated Snippet
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
source lib.sh
if ! modprobe -q -n br_netfilter 2>&1; then
echo "SKIP: Test needs br_netfilter kernel module"
exit $ksft_skip
fi
cleanup()
{
cleanup_all_ns
}
trap cleanup EXIT
setup_ns host vtep router
create_topology()
{
ip link add host-eth0 netns "$host" type veth peer name vtep-host netns "$vtep"
ip link add vtep-router netns "$vtep" type veth peer name router-vtep netns "$router"
}
setup_host()
{
# bring ports up
ip -n "$host" addr add 10.0.0.1/24 dev host-eth0
ip -n "$host" link set host-eth0 up
# Add VLAN 10,20
for vid in 10 20; do
ip -n "$host" link add link host-eth0 name host-eth0.$vid type vlan id $vid
ip -n "$host" addr add 10.0.$vid.1/24 dev host-eth0.$vid
ip -n "$host" link set host-eth0.$vid up
done
}
setup_vtep()
{
# create bridge on vtep
ip -n "$vtep" link add name br0 type bridge
ip -n "$vtep" link set br0 type bridge vlan_filtering 1
# VLAN 10 is untagged PVID
ip -n "$vtep" link set dev vtep-host master br0
bridge -n "$vtep" vlan add dev vtep-host vid 10 pvid untagged
# VLAN 20 as other VID
ip -n "$vtep" link set dev vtep-host master br0
bridge -n "$vtep" vlan add dev vtep-host vid 20
# single-vxlan device on vtep
ip -n "$vtep" address add dev vtep-router 60.0.0.1/24
ip -n "$vtep" link add dev vxd type vxlan external \
vnifilter local 60.0.0.1 remote 60.0.0.2 dstport 4789 ttl 64
ip -n "$vtep" link set vxd master br0
# Add VLAN-VNI 1-1 mappings
bridge -n "$vtep" link set dev vxd vlan_tunnel on
for vid in 10 20; do
bridge -n "$vtep" vlan add dev vxd vid $vid
bridge -n "$vtep" vlan add dev vxd vid $vid tunnel_info id $vid
bridge -n "$vtep" vni add dev vxd vni $vid
done
# bring ports up
ip -n "$vtep" link set vxd up
ip -n "$vtep" link set vtep-router up
Annotation
- Detected declarations: `function cleanup`.
- 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.