Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2252171ybd; Mon, 24 Jun 2019 03:20:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyL30G/np3rlvV1GXzg7S+dr8YdnCo9MvBNEihEeX+QgCiSTW0mBE74gkD99nsI+k55BStm X-Received: by 2002:a17:902:2aab:: with SMTP id j40mr103085876plb.76.1561371623194; Mon, 24 Jun 2019 03:20:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561371623; cv=none; d=google.com; s=arc-20160816; b=C5dfOGR52BIAsKT+HDWzvGTMrejwjKOQQjXB3m22xmE6KnCaFGJ7vYziwYgSNzTois zvn3Wd080583MVESHgcwM4MzO0jm+MFVXIXJwzwSwXd5tpDyLssxRcMMAjZndYWyJxqX 6AnnFRwtqeLfzj8u/fINyjGHlKmND3IobEE9GaeYnDGkfOgVbAgQDGSyg0YLGcS9msaV 7FHZy1ZZF8hK5fFXDNN9P0Z9X1hrgQ+DkgHEbBc9YNqk4UThEfWphy7j97ftX7pLOqPZ t7hH88BkkkcIQ+3Rg9y0THOT6ay7FvtuTlCxU52zs7wxTQWgHYTOFeGUmEdeJTEty24I 2y0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=G1/ih/9RdylEdxg3GLNwC0JeeyWG+PoOyQJ9fEqfABs=; b=oSAy6YUdSvjEIxwU0WNRK/TiEnwIqnf0zz/ENRVFyJ6Ncm0uP5W5yNppVm56giuC7e y22Bl8BQ1byJqxqnyir7kKDebbmTEb6nR9uT565A03qUZCoH2ti8ABtKKNoBI7LsYYh/ ywze/8PHC5HTUgszQcN+vcFTHvU6M92XdeCgBTUrBLi6CgBOhde3c02wW8RcDXUJk5jB TwJx9T8C8JTvIPo48T3ECm4YzURTuwb+/s9Gogprnn0+b1aL4hQPCfAGEjbo1DmJJIfl K+Ql1onVrcc8Fs0fQb3jDzsX20httQXFo5BixShRxAbE4xzqcpTHsZ5eGsokKR9Ja9VN gOew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2Zv6qOVS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si11343201pfj.93.2019.06.24.03.20.08; Mon, 24 Jun 2019 03:20:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2Zv6qOVS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730079AbfFXKPx (ORCPT + 99 others); Mon, 24 Jun 2019 06:15:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:53230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730290AbfFXKPu (ORCPT ); Mon, 24 Jun 2019 06:15:50 -0400 Received: from localhost (f4.8f.5177.ip4.static.sl-reverse.com [119.81.143.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5525A205ED; Mon, 24 Jun 2019 10:15:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561371349; bh=c5tfn4MH4/BMFzGVpBIQr2Pi7Q9VQ4m2MhLwf7RD09Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2Zv6qOVSjRQpg2idxql2RmxYN5iJ8xkyA0ZQZJEZdNc6h41jedGbCo7n8vEb7da2o NHIyvRQ2iyATi1d0e5NCgsnXiQ4N6bxInqQT1/q9MurYJ35Dgjp1FgPsSAoK2lQWzr a+KMVWEnxsYKYaNGD5vcU7aWbxqpaBAC3r8bafSs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xin Long , "David S. Miller" , Sasha Levin Subject: [PATCH 5.1 069/121] selftests: set sysctl bc_forwarding properly in router_broadcast.sh Date: Mon, 24 Jun 2019 17:56:41 +0800 Message-Id: <20190624092324.407243019@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190624092320.652599624@linuxfoundation.org> References: <20190624092320.652599624@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 67c0aaa1eaec60e9dab301012bdebe6726ae04bd ] sysctl setting bc_forwarding for $rp2 is needed when ping_test_from h2, otherwise the bc packets from $rp2 won't be forwarded. This patch is to add this setting for $rp2. Also, as ping_test_from does grep "$from" only, which could match some unexpected output, some test case doesn't really work, like: # ping_test_from $h2 198.51.200.255 198.51.200.2 PING 198.51.200.255 from 198.51.100.2 veth3: 56(84) bytes of data. 64 bytes from 198.51.100.1: icmp_seq=1 ttl=64 time=0.336 ms When doing grep $form (198.51.200.2), the output could still match. So change to grep "bytes from $from" instead. Fixes: 40f98b9af943 ("selftests: add a selftest for directed broadcast forwarding") Signed-off-by: Xin Long Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- tools/testing/selftests/net/forwarding/router_broadcast.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/router_broadcast.sh b/tools/testing/selftests/net/forwarding/router_broadcast.sh index 9a678ece32b4..4eac0a06f451 100755 --- a/tools/testing/selftests/net/forwarding/router_broadcast.sh +++ b/tools/testing/selftests/net/forwarding/router_broadcast.sh @@ -145,16 +145,19 @@ bc_forwarding_disable() { sysctl_set net.ipv4.conf.all.bc_forwarding 0 sysctl_set net.ipv4.conf.$rp1.bc_forwarding 0 + sysctl_set net.ipv4.conf.$rp2.bc_forwarding 0 } bc_forwarding_enable() { sysctl_set net.ipv4.conf.all.bc_forwarding 1 sysctl_set net.ipv4.conf.$rp1.bc_forwarding 1 + sysctl_set net.ipv4.conf.$rp2.bc_forwarding 1 } bc_forwarding_restore() { + sysctl_restore net.ipv4.conf.$rp2.bc_forwarding sysctl_restore net.ipv4.conf.$rp1.bc_forwarding sysctl_restore net.ipv4.conf.all.bc_forwarding } @@ -171,7 +174,7 @@ ping_test_from() log_info "ping $dip, expected reply from $from" ip vrf exec $(master_name_get $oif) \ $PING -I $oif $dip -c 10 -i 0.1 -w $PING_TIMEOUT -b 2>&1 \ - | grep $from &> /dev/null + | grep "bytes from $from" > /dev/null check_err_fail $fail $? } -- 2.20.1