Skip to content

RFC net/route: Rewrite route{4, 6}-change-{dst, gw} into C

Alexey Kodanev ltp 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest posting 2/21 of 6 patches 0 repliesNew
  2. v2 RFC posting 1/21 of 6 patches 0 repliesSuperseded

1 of 6 patches is in this archive. The cover letter announces 6.

Patches in v2 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
6/6net/route: Rewrite route{4, 6}-change-{dst, gw} into C+0 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [LTP] [RFC PATCH v2 0/6] net/route: Rewrite route{4, 6}-change-{dst, gw} into C

Hi Petr,

Quoted 6 lines · Petr Vorel

Hi Alexey,

thanks for your comments. I suppose you don't see much point of rewriting tests into C (and depending on libmnl). The original idea was to change it fast enough with C to really stress it. OK, let's leave it :).

Sorry for the delay, it would be good to have a shell variant with the ping (so we can verify the route) and also keep the libmnl test-case to stress the creation/deletion.

Quoted 41 lines
Quoted 13 lines
Quoted 13 lines

do_test()

{
	local iface=$(tst_iface)
	local addr new_rt

	new_rt="$(tst_ipaddr_un $1)/$mask"
	addr="$(tst_ipaddr_un $1 1)"

	tst_res TINFO "testing route '$new_rt'"

	tst_rhost_run -s -c "ip addr add $addr/$mask dev $(tst_iface rhost)"
	ROD ip route add $new_rt dev $iface
	ROD ip neigh replace $addr lladdr $(tst_hwaddr rhost) nud permanent dev $iface
Quoted 7 lines
Quoted 5 lines
Quoted 1 line

EXPECT_PASS ns-udpsender -f $TST_IPVER -D $addr -p $1 -o -s $udp_size

	ROD ip neigh del $addr lladdr $(tst_hwaddr rhost) dev $iface
	ROD ip route del $new_rt dev $iface
	tst_rhost_run -c "ip addr del $addr/$mask dev $(tst_iface rhost)"

With ns-udpsender, I think it can be without setting ip addresses:

Route over gateway requires (on IPv6) gateway on rhost, which is requires to create this IP address first.

Review

Quoted 12 lines
(quoted diff) +0 -0
 	ROD ip route add $new_rt dev $iface
 	ROD ip neigh replace $addr lladdr $(tst_hwaddr rhost) nud permanent dev $iface
 	EXPECT_PASS ns-udpsender -f $TST_IPVER -D $addr -p $1 -o -s $udp_size> 
	ROD ip neigh del $addr lladdr $(tst_hwaddr rhost) dev $iface

ROD ip route del $new_rt dev $iface

But with ping and neighbor discovery:

(quoted diff) +0 -0
 	tst_rhost_run -s -c "ip addr add $addr/$mask dev $(tst_iface rhost)"
 	ROD ip route add $new_rt dev $iface
 	EXPECT_PASS ping$TST_IPVER ...
 	ROD ip route del $new_rt dev $iface
 	tst_rhost_run -c "ip addr del $addr/$mask dev $(tst_iface rhost)"

I prefer using ping and neighbor discovery. I suppose these are both equivalent (if not it'd be good to run them both).

Kind regards,
Petr