network/route: accept an empty network address as the destination.
* linux + BSD accept 0.0.0.0 or :: as the default route identifier * openvpn passes 0.0.0.0 as the default route * our own route command shows "0.0.0.0" for the default route Lets not be special here, and do what everyone else does. default still works for backwards compat. This uncovered a potental bug in BNetworkAddress. See #19296 Change-Id: I3aea99cae4cf9c52142cb97e2a06b8432de294b9 Reviewed-on: https://review.haiku-os.org/c/haiku/+/8592 Reviewed-by: Adrien Destugues <[email protected]> Tested-by: Commit checker robot <[email protected]> Reviewed-by: Fredrik Holmqvist <[email protected]> Reviewed-by: Alexander von Gluck <[email protected]> Haiku-Format: Haiku-format Bot <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
3b8cfd27cc
commit
796bd00681
@@ -431,6 +431,10 @@ main(int argc, char** argv)
|
|||||||
i++;
|
i++;
|
||||||
break;
|
break;
|
||||||
} else if (parse_address(familyIndex, argv[i], destination)) {
|
} else if (parse_address(familyIndex, argv[i], destination)) {
|
||||||
|
if (destination.IsEmpty()) {
|
||||||
|
defaultRoute = true;
|
||||||
|
route.flags = RTF_DEFAULT;
|
||||||
|
}
|
||||||
i++;
|
i++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user