netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Ahern <dsahern@gmail.com>, David Ahern <dsahern@kernel.org>,
	davem@davemloft.net, jakub.kicinski@netronome.com
Cc: netdev@vger.kernel.org, rajendra.dendukuri@broadcom.com
Subject: Re: [PATCH net v2] ipv6: Handle race in addrconf_dad_work
Date: Thu, 3 Oct 2019 10:19:30 -0700	[thread overview]
Message-ID: <0471f2fd-c472-34c1-5dab-0aa01c837322@gmail.com> (raw)
In-Reply-To: <43e2c04f-a601-3363-1f98-26fd007be960@gmail.com>



On 10/3/19 9:32 AM, Eric Dumazet wrote:
> 

> 
> Still no luck for me :/
> 

One of the failing test was :

unshare -n
./traceroute_test.sh -I icmp


$ cat ./traceroute_test.sh
#!/bin/bash
#
# Test traceroute.
#
# This is a test to run traceroute with the given parameters. It sets up three
# containers, source, router, and destination, connected via two pairs of veth:
#
#  source veth0src<-->veth0rtr router veth1rtr<-->veth1dst destination
#
# Then it runs traceroutes from source to destination in the source container.

set -Euex

readonly src="src-$$"
readonly rtr="rtr-$$"
readonly dst="dst-$$"

readonly SRC_IP6='2002:a00:1::1/24'
readonly DST_IP6='2002:b00:1::1/24'
readonly RTR_SRC_IP6='2002:a00:1::2/24'
readonly RTR_DST_IP6='2002:b00:1::2/24'
readonly SRC_NET6='2002:a00::/24'
readonly DST_NET6='2002:b00::/24'
readonly SRC_IP4='10.0.1.1/24'
readonly DST_IP4='10.0.2.1/24'
readonly RTR_SRC_IP4='10.0.1.2/24'
readonly RTR_DST_IP4='10.0.2.2/24'

init() {
  ip netns add "${src}"
  ip netns add "${rtr}"
  ip netns add "${dst}"

  ip link add veth0rtr type veth peer name veth0src
  ip link add veth1rtr type veth peer name veth1dst
  ip link set veth0rtr netns "${rtr}"
  ip link set veth0src netns "${src}"
  ip link set veth1rtr netns "${rtr}"
  ip link set veth1dst netns "${dst}"
}

setup() {
  local -r NS="$1"
  local -r IF="$2"
  local -r IP4="$3"
  local -r IP6="$4"

  ip -n "${NS}" link set lo up

  ip -n "${NS}" link set "${IF}" up
  ip -n "${NS}" -4 addr add "${IP4}" dev "${IF}"
  ip -n "${NS}" -6 addr add "${IP6}" dev "${IF}" nodad
  ip netns exec "${NS}" sysctl net.ipv4.conf.all.forwarding=1
  ip netns exec "${NS}" sysctl net.ipv6.conf.all.forwarding=1
}

route() {
  ip -n "${src}" route add default via "${RTR_SRC_IP4%/*}"
  ip -n "${dst}" route add default via "${RTR_DST_IP4%/*}"

  ip -n "${rtr}" -6 route add "${SRC_NET6}" dev veth0rtr
  ip -n "${rtr}" -6 route add "${DST_NET6}" dev veth1rtr
  ip -n "${src}" -6 route add default dev veth0src
  ip -n "${dst}" -6 route add default dev veth1dst
  ip -n "${src}" -6 route add "${DST_NET6}" via "${RTR_SRC_IP6%/*}"
  ip -n "${dst}" -6 route add "${SRC_NET6}" via "${RTR_DST_IP6%/*}"
}

fini() {
  set +e

  # Run ping and ping6 to have reachability data in the logs, in case the
  # test fails. We want to know that whether a failure is casued because of
  # a regression for traceroute.
  ip netns exec "${src}" ping "${DST_IP4%/*}" -c 3
  ip netns exec "${src}" ping6 "${DST_IP6%/*}" -c 3

  ip netns del "${src}"
  ip netns del "${rtr}"
  ip netns del "${dst}"
}

chk_traceroute() {
  if [[ "$(grep '*' | wc -l)" != "0" ]]; then
    echo 'FAILED'
    exit 1
  fi
}

main() {
  trap fini EXIT

  init

  setup "${src}" veth0src "${SRC_IP4}" "${SRC_IP6}"
  setup "${dst}" veth1dst "${DST_IP4}" "${DST_IP6}"
  setup "${rtr}" veth0rtr "${RTR_SRC_IP4}" "${RTR_SRC_IP6}"
  setup "${rtr}" veth1rtr "${RTR_DST_IP4}" "${RTR_DST_IP6}"

  route

  sleep 1

  ip netns exec "${src}" traceroute "${DST_IP4%/*}" "$@" -4 -n -m 2 -z 1 | \
      chk_traceroute
  ip netns exec "${src}" traceroute "${DST_IP6%/*}" "$@" -6 -n -m 2 -z 1 | \
      chk_traceroute
  echo 'PASSED'
}

main "$@"; exit


  reply	other threads:[~2019-10-03 17:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01  3:28 [PATCH net v2] ipv6: Handle race in addrconf_dad_work David Ahern
2019-10-01 18:18 ` Eric Dumazet
2019-10-02 21:08   ` Eric Dumazet
2019-10-02 21:23     ` Eric Dumazet
2019-10-02 22:13       ` David Ahern
2019-10-02 22:21         ` Eric Dumazet
2019-10-02 22:33           ` David Ahern
2019-10-02 22:36             ` Eric Dumazet
2019-10-02 23:11               ` Eric Dumazet
2019-10-02 23:37                 ` David Ahern
2019-10-03  0:10               ` David Ahern
2019-10-03  0:36                 ` Eric Dumazet
2019-10-03  2:42                   ` David Ahern
2019-10-03 15:50       ` David Ahern
2019-10-03 16:32         ` Eric Dumazet
2019-10-03 17:19           ` Eric Dumazet [this message]
2019-10-03 19:29             ` David Ahern
2019-10-02  1:45 ` David Miller
2019-10-06 11:46 ` [ipv6] 58a3c210a3: ltp.ping601.fail kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0471f2fd-c472-34c1-5dab-0aa01c837322@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=jakub.kicinski@netronome.com \
    --cc=netdev@vger.kernel.org \
    --cc=rajendra.dendukuri@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).