Skip to content

Commit

Permalink
For testing IPv6 multicast on Linux use any multicast capable interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluhm committed Jan 9, 2025
1 parent fbaa03e commit 7aaa894
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ install:
install -c -m 555 -s udpbench -D -t ${DESTDIR}${BINDIR}
install -c -m 444 udpbench.1 -D -t ${DESTDIR}${MANDIR}1

# use any multicast capable interface; as -L1 is set, test runs on loopback
INTERFACE = $(shell ip link show | \
awk '/MULTICAST/{print gensub(":.*","",1,$$2); exit}')

TEST =
TEST += localhost
test-localhost:
Expand Down Expand Up @@ -70,14 +74,14 @@ test-mcast:
grep -q 'sockname: 224.0.0.123 ' out
grep -q 'recv: syscalls ' out

# XXX Linux fails to receive on loopback, disable test for now.
#TEST += mcast6
# XXX Linux fails to send on loopback, use any ethernet
TEST += mcast6
test-mcast6:
@echo -e '\n==== $@ ===='
./udpbench -Ilo -p0 -t3 recv ff04::123 | tee out & \
./udpbench -I$(INTERFACE) -p0 -t3 recv ff04::123 | tee out & \
sleep 1; \
port=`awk '/^sockname:/{print $$3}' out`; \
./udpbench -L1 -T0 -p$$port -t1 \
./udpbench -I$(INTERFACE) -L1 -T0 -p$$port -t1 \
send ff04::123 || exit 1; \
wait $$!
grep -q 'sockname: ff04::123 ' out
Expand All @@ -96,14 +100,14 @@ test-mcast-repeat:
grep -q 'sockname: 224.0.0.124 ' out
grep -q 'recv: syscalls ' out

# XXX Linux fails to receive on loopback, disable test for now.
#TEST += mcast6-repeat
# XXX Linux fails to send on loopback, use any ethernet
TEST += mcast6-repeat
test-mcast6-repeat:
@echo -e '\n==== $@ ===='
./udpbench -N2 -Ilo -p0 -t3 recv ff04::123 | tee out & \
./udpbench -N2 -I$(INTERFACE) -p0 -t3 recv ff04::123 | tee out & \
sleep 1; \
port=`awk '/^sockname:/{print $$3}' out | sort -u`; \
./udpbench -N2 -L1 -T0 -p$$port -t1 \
./udpbench -N2 -I$(INTERFACE) -L1 -T0 -p$$port -t1 \
send ff04::123 || exit 1; \
wait $$!
grep -q 'sockname: ff04::123 ' out
Expand Down

0 comments on commit 7aaa894

Please sign in to comment.