From: Veaceslav Falico <vfalico@redhat.com>
To: netdev@vger.kernel.org
Cc: "Veaceslav Falico" <vfalico@redhat.com>,
"François CACHEREUL" <f.cachereul@alphalink.fr>,
"Zhenjie Chen" <zhchen@redhat.com>,
"Jay Vosburgh" <fubar@us.ibm.com>,
"Andy Gospodarek" <andy@greyhouse.net>
Subject: [PATCH v2 net-next] bonding: send arp requests even if there's no route to them
Date: Fri, 28 Feb 2014 12:39:19 +0100 [thread overview]
Message-ID: <1393587559-26437-1-git-send-email-vfalico@redhat.com> (raw)
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 <f.cachereul@alphalink.fr>
CC: Zhenjie Chen <zhchen@redhat.com>
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
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..12861e3 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 && net_ratelimit())
+ 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;
}
--
1.8.4
next reply other threads:[~2014-02-28 11:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-28 11:39 Veaceslav Falico [this message]
2014-03-02 19:54 ` [PATCH v2 net-next] bonding: send arp requests even if there's no route to them David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1393587559-26437-1-git-send-email-vfalico@redhat.com \
--to=vfalico@redhat.com \
--cc=andy@greyhouse.net \
--cc=f.cachereul@alphalink.fr \
--cc=fubar@us.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=zhchen@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).