1#!/bin/sh 2# SPDX-License-Identifier: GPL-2.0-or-later 3# Copyright (c) 2006 International Business Machines Corp. 4# Copyright (c) 2020 Joerg Vehlow <joerg.vehlow@aox-tech.de> 5# Author: Mitsuru Chinen <mitch@jp.ibm.com> 6# 7# Verify that the kernel is not crashed when joining multiple multicast 8# groups on separate socket, then receiving a large number of General Queries 9 10TST_NEEDS_ROOT=1 11TST_NEEDS_TMPDIR=1 12TST_SETUP="mcast_setup_normal" 13TST_CLEANUP="mcast_cleanup" 14TST_TESTFUNC="do_test" 15. mcast-lib.sh 16 17do_test() 18{ 19 tst_res TINFO "joining $MCASTNUM_NORMAL IPv${TST_IPVER} multicast groups on separate socket, then receiving a large number of General Queries in $NS_DURATION seconds" 20 21 local prefix="$MCAST_IPV4_ADDR_PREFIX" 22 [ "$TST_IPV6" ] && prefix="$MCAST_IPV6_ADDR_PREFIX" 23 24 # Run a multicast join tool 25 local tmpfile=$$ 26 EXPECT_PASS $MCAST_LCMD -n $MCASTNUM_NORMAL -p $prefix \> $tmpfile 27 tst_res TINFO "joined $(grep groups $tmpfile)" 28 29 # Send General Queries from the remote host 30 local params 31 [ "$TST_IPV6" ] && params="-S $(tst_ipaddr) -m" 32 EXPECT_RHOST_PASS $MCAST_RCMD -t $NS_DURATION -r 0 $params 33} 34 35tst_run 36