From: Jakub Sitnicki <jkbs@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org
Subject: [iproute PATCH] iproute: Remove useless check for nexthop keyword when setting RTA_OIF
Date: Wed, 7 Jun 2017 15:23:13 +0200 [thread overview]
Message-ID: <20170607132313.5290-1-jkbs@redhat.com> (raw)
When modifying a route we set the RTA_OIF attribute only if a device was
specified with "dev" or "oif" keyword. But for some unknown reason we
earlier alternatively check also for the presence of "nexthop" keyword,
even though it has no effect. So remove the pointless check.
Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>
---
ip/iproute.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/ip/iproute.c b/ip/iproute.c
index b4ca291..4fd36a1 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -1241,16 +1241,14 @@ static int iproute_modify(int cmd, unsigned int flags, int argc, char **argv)
if (!dst_ok)
usage();
- if (d || nhs_ok) {
+ if (d) {
int idx;
- if (d) {
- if ((idx = ll_name_to_index(d)) == 0) {
- fprintf(stderr, "Cannot find device \"%s\"\n", d);
- return -1;
- }
- addattr32(&req.n, sizeof(req), RTA_OIF, idx);
+ if ((idx = ll_name_to_index(d)) == 0) {
+ fprintf(stderr, "Cannot find device \"%s\"\n", d);
+ return -1;
}
+ addattr32(&req.n, sizeof(req), RTA_OIF, idx);
}
if (mxrta->rta_len > RTA_LENGTH(0)) {
--
2.9.4
next reply other threads:[~2017-06-07 13:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-07 13:23 Jakub Sitnicki [this message]
2017-06-14 16:57 ` [iproute PATCH] iproute: Remove useless check for nexthop keyword when setting RTA_OIF Stephen Hemminger
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=20170607132313.5290-1-jkbs@redhat.com \
--to=jkbs@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/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).