]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
iproute: Remove useless check for nexthop keyword when setting RTA_OIF
authorJakub Sitnicki <jkbs@redhat.com>
Wed, 7 Jun 2017 13:23:13 +0000 (15:23 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 14 Jun 2017 16:56:05 +0000 (09:56 -0700)
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

index b4ca2911a5dfb66759c7e1aba84c345a60ba9d2a..4fd36a1e5b74d126c974518c1191a9abc1755e4d 100644 (file)
@@ -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)) {