Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp436845yba; Wed, 15 May 2019 04:05:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMpYU4hcIjlodUGdFwH08ZFIMHm4621HIECZzBOvHLD5yVyJwKeo6vK/I4uwZUK3W2bhkM X-Received: by 2002:a62:2ce:: with SMTP id 197mr8046696pfc.5.1557918330776; Wed, 15 May 2019 04:05:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557918330; cv=none; d=google.com; s=arc-20160816; b=Rh+aOwEn4cDJLEm/+ASf7CzADE14Q59Le5gJT8o07FWJbe1Pz0SQiI7PSWOGvZ6/zQ hqx2SmLirddu54PEAKqpjXtaoHt/lFuNAl0inY1Qb5tgFjAbkbZ1Vpr3bq7VM6igW9bd EBzQKuEIEGzB4hLDed3GPgjsMA8SLfFDPNIqemdz+ljeaCkUxbpExj4SvBiAXJRN39FN VNrkuoPlQhF/FBdCCZ9z5u34SZNIPD60MEYVrhtmwX9bYP8xudZHvO8nhFg+rqpexI4v URwqUrv8tsih2MWYpkvn0GUSQRDtGL1WtDpfCu2iUL4OoFyzEmeaCtGgOizxBvBr9pUV 9c5Q== 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=NVh3XkShWYaDybzk8R+R0+nA/bJ82YowVFBAgX50JWY=; b=Npk+WWHRUMmFEucbki/ZFN8rJNo2guwiuTlXukCpTmgO7sAdVqVCGHngPFe3rTsQ6A aWax+STv24inPMxLvoWA6HdUvwvCutI8q9+1cD55SYAYSI/N1Zf5xWF1C6iDRp6cP8Ly Nloh+pCnLYDtg8H4hfUwU9Xz6F3vqXVZADeR14DziJDi9GnAyjD9FzWteQdYTIieK//z OWCi2LJTiqK6pWyeJnaMEFr+p6Jq0ghsyYrwyRPIOS+CYHVCKj3yVSWi2fBXm/HZERz3 u9nG4jgsj8m9mYGz72r5LWaokWAqqAE8xnD5dSQBYQ70PKfYRr4fcYRgeuGUVTWBDKWA vjNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zN9ohaIH; 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 d192si1537165pgc.480.2019.05.15.04.05.15; Wed, 15 May 2019 04:05:30 -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=zN9ohaIH; 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 S1727691AbfEOLBW (ORCPT + 99 others); Wed, 15 May 2019 07:01:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:58314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727092AbfEOLBR (ORCPT ); Wed, 15 May 2019 07:01:17 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 1C4632173C; Wed, 15 May 2019 11:01:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557918076; bh=Ae834Yg6qZ5u8T4XF6JHp9pzGVNBWpmWOlqXab3Qssk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zN9ohaIHmKvlYsvzKGfky4pvE1FGYZv14RlTnMGKn8WDX+N+03ZIx62AauWQRDNRX 6jpfDWToY4MKgCLnuPDk5GEC1q9IE2vFTFm6/h42SYo1s88gQsugjzI+QdSWi3F4zk 83cw4J6YF9/+AvyYNWSif8K+qJUcqP2eX3STgApU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , "David S. Miller" , netdev@vger.kernel.org, Jarod Wilson , Jay Vosburgh Subject: [PATCH 3.18 83/86] bonding: fix arp_validate toggling in active-backup mode Date: Wed, 15 May 2019 12:56:00 +0200 Message-Id: <20190515090656.025421215@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090642.339346723@linuxfoundation.org> References: <20190515090642.339346723@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 From: Jarod Wilson [ Upstream commit a9b8a2b39ce65df45687cf9ef648885c2a99fe75 ] There's currently a problem with toggling arp_validate on and off with an active-backup bond. At the moment, you can start up a bond, like so: modprobe bonding mode=1 arp_interval=100 arp_validate=0 arp_ip_targets=192.168.1.1 ip link set bond0 down echo "ens4f0" > /sys/class/net/bond0/bonding/slaves echo "ens4f1" > /sys/class/net/bond0/bonding/slaves ip link set bond0 up ip addr add 192.168.1.2/24 dev bond0 Pings to 192.168.1.1 work just fine. Now turn on arp_validate: echo 1 > /sys/class/net/bond0/bonding/arp_validate Pings to 192.168.1.1 continue to work just fine. Now when you go to turn arp_validate off again, the link falls flat on it's face: echo 0 > /sys/class/net/bond0/bonding/arp_validate dmesg ... [133191.911987] bond0: Setting arp_validate to none (0) [133194.257793] bond0: bond_should_notify_peers: slave ens4f0 [133194.258031] bond0: link status definitely down for interface ens4f0, disabling it [133194.259000] bond0: making interface ens4f1 the new active one [133197.330130] bond0: link status definitely down for interface ens4f1, disabling it [133197.331191] bond0: now running without any active interface! The problem lies in bond_options.c, where passing in arp_validate=0 results in bond->recv_probe getting set to NULL. This flies directly in the face of commit 3fe68df97c7f, which says we need to set recv_probe = bond_arp_recv, even if we're not using arp_validate. Said commit fixed this in bond_option_arp_interval_set, but missed that we can get to that same state in bond_option_arp_validate_set as well. One solution would be to universally set recv_probe = bond_arp_recv here as well, but I don't think bond_option_arp_validate_set has any business touching recv_probe at all, and that should be left to the arp_interval code, so we can just make things much tidier here. Fixes: 3fe68df97c7f ("bonding: always set recv_probe to bond_arp_rcv in arp monitor") CC: Jay Vosburgh CC: Veaceslav Falico CC: Andy Gospodarek CC: "David S. Miller" CC: netdev@vger.kernel.org Signed-off-by: Jarod Wilson Signed-off-by: Jay Vosburgh Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/bonding/bond_options.c | 7 ------- 1 file changed, 7 deletions(-) --- a/drivers/net/bonding/bond_options.c +++ b/drivers/net/bonding/bond_options.c @@ -1032,13 +1032,6 @@ static int bond_option_arp_validate_set( { netdev_info(bond->dev, "Setting arp_validate to %s (%llu)\n", newval->string, newval->value); - - if (bond->dev->flags & IFF_UP) { - if (!newval->value) - bond->recv_probe = NULL; - else if (bond->params.arp_interval) - bond->recv_probe = bond_arp_rcv; - } bond->params.arp_validate = newval->value; return 0;