X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ip%2Fiproute.c;h=cc02a3e1b0aa65ba1e4f1c4e701d3897a1e14ff6;hb=c2f9dc14c41f388764f7634d36c3d05e354f053a;hp=5f58a3b344061c991fef31df75f1cf29fa18a64b;hpb=8513f4a92657c0418043dafd9efdaa047b7f7132;p=mirror_iproute2.git diff --git a/ip/iproute.c b/ip/iproute.c index 5f58a3b3..cc02a3e1 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -1932,6 +1932,7 @@ static int iproute_get(int argc, char **argv) int fib_match = 0; int from_ok = 0; unsigned int mark = 0; + bool address_found = false; iproute_reset_filter(0); filter.cloned = 2; @@ -2037,11 +2038,12 @@ static int iproute_get(int argc, char **argv) addattr_l(&req.n, sizeof(req), RTA_DST, &addr.data, addr.bytelen); req.r.rtm_dst_len = addr.bitlen; + address_found = true; } argc--; argv++; } - if (req.r.rtm_dst_len == 0) { + if (!address_found) { fprintf(stderr, "need at least a destination address\n"); return -1; }