From patchwork Fri Feb 28 10:57:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Veaceslav Falico X-Patchwork-Id: 325134 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 347232C0079 for ; Fri, 28 Feb 2014 22:02:20 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751522AbaB1LCO (ORCPT ); Fri, 28 Feb 2014 06:02:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:18434 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751157AbaB1LCN (ORCPT ); Fri, 28 Feb 2014 06:02:13 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1SB275I008887 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 28 Feb 2014 06:02:08 -0500 Received: from darkmag.usersys.redhat.com (dhcp-27-102.brq.redhat.com [10.34.27.102]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s1SB24qq022694; Fri, 28 Feb 2014 06:02:05 -0500 From: Veaceslav Falico To: netdev@vger.kernel.org Cc: Veaceslav Falico , =?UTF-8?q?Fran=C3=A7ois=20CACHEREUL?= , Zhenjie Chen , Jay Vosburgh , Andy Gospodarek Subject: [PATCH net-next] bonding: send arp requests even if there's no route to them Date: Fri, 28 Feb 2014 11:57:56 +0100 Message-Id: <1393585076-22786-1-git-send-email-vfalico@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Currently we're only sending arp requests if we have a route to the target (and, thus, can find out the source ip address). There are some use cases, however, where we don't want/need to set an ip address (or set up a specific route) for bonding to use arp monitoring *for traffic generation*. We can easily send arp probes (arp requests with src ip == 0) to generate arp broadcast responses from the target ip and use them for determining if the target is up. This, obviously, won't work with arp validation - because we don't have the ip address set and, thus, will filter out the responses. So in that case - print a warning. CC: François CACHEREUL CC: Zhenjie Chen CC: Jay Vosburgh CC: Andy Gospodarek Signed-off-by: Veaceslav Falico --- drivers/net/bonding/bond_main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 12948b3..a217536 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2155,8 +2155,13 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) rt = ip_route_output(dev_net(bond->dev), targets[i], 0, RTO_ONLINK, 0); if (IS_ERR(rt)) { - pr_debug("%s: no route to arp_ip_target %pI4\n", - bond->dev->name, &targets[i]); + /* there's no route to target - try to send arp + * probe to generate any traffic (arp_validate=0) + */ + if (bond->params.arp_validate) + pr_warn("%s: no route to arp_ip_target %pI4 and arp_validate is set\n", + bond->dev->name, &targets[i]); + bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], 0, 0); continue; }