#!/bin/bash # SPDX-License-Identifier: GPL-2.0+ # # Author: Justin Iurman <justin.iurman@uliege.be> # # WARNING # ------- # This is just a dummy script that triggers encap cases with possible dst cache # reference loops in affected lwt users (see list below). Some cases are # pathological configurations for simplicity, others are valid. Overall, we # don't want this issue to happen, no matter what. In order to catch any # reference loops, kmemleak MUST be used. The results alone are always blindly # successful, don't rely on them. Note that the following tests may crash the # kernel if the fix to prevent lwtunnel_{input|output|xmit}() reentry loops is # not present. # # Affected lwt users so far (please update accordingly if needed): # - ila_lwt (output only) # - ioam6_iptunnel (output only) # - rpl_iptunnel (both input and output) # - seg6_iptunnel (both input and output)
source lib.sh
check_compatibility()
{
setup_ns tmp_node &>/dev/null if [ $? != 0 ]; then echo"SKIP: Cannot create netns."
exit $ksft_skip fi
ip link add name veth0 netns $tmp_node type veth \
peer name veth1 netns $tmp_node &>/dev/null
local ret=$?
ip -netns $tmp_node link set veth0 up &>/dev/null
ret=$((ret + $?))
ip -netns $tmp_node link set veth1 up &>/dev/null
ret=$((ret + $?))
if [ $ret != 0 ]; then echo"SKIP: Cannot configure links."
cleanup_ns $tmp_node
exit $ksft_skip fi
ip link add name veth-alpha netns $alpha type veth \
peer name veth-betaL netns $beta &>/dev/null
ip link add name veth-betaR netns $beta type veth \
peer name veth-gamma netns $gamma &>/dev/null
ip -netns $alpha link set veth-alpha name veth0 &>/dev/null
ip -netns $beta link set veth-betaL name veth0 &>/dev/null
ip -netns $beta link set veth-betaR name veth1 &>/dev/null
ip -netns $gamma link set veth-gamma name veth0 &>/dev/null
ip -netns $alpha addr add 2001:db8:1::2/64 dev veth0 &>/dev/null
ip -netns $alpha link set veth0 up &>/dev/null
ip -netns $alpha link set lo up &>/dev/null
ip -netns $alpha route add 2001:db8:2::/64 \
via 2001:db8:1::1 dev veth0 &>/dev/null
ip -netns $beta addr add 2001:db8:1::1/64 dev veth0 &>/dev/null
ip -netns $beta addr add 2001:db8:2::1/64 dev veth1 &>/dev/null
ip -netns $beta link set veth0 up &>/dev/null
ip -netns $beta link set veth1 up &>/dev/null
ip -netns $beta link set lo up &>/dev/null
ip -netns $beta route del 2001:db8:2::/64
ip -netns $beta route add 2001:db8:2::/64 dev veth1
ip netns exec $beta \
sysctl -wq net.ipv6.conf.all.forwarding=1 &>/dev/null
ip -netns $gamma addr add 2001:db8:2::2/64 dev veth0 &>/dev/null
ip -netns $gamma link set veth0 up &>/dev/null
ip -netns $gamma link set lo up &>/dev/null
ip -netns $gamma route add 2001:db8:1::/64 \
via 2001:db8:2::1 dev veth0 &>/dev/null
sleep 1
ip netns exec $alpha ping6 -c 5 -W 1 2001:db8:2::2 &>/dev/null if [ $? != 0 ]; then echo"SKIP: Setup failed."
exit $ksft_skip fi
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.