On Mon, Oct 16, 2017 at 01:18:27PM +0200, Martin Pieuchot wrote:
> Removing the if () block should do it. It introduces a small change in
> behavior, route(8) now exists with an error code if an entry doesn't
> exist in the table. That's a good thing, because one can now test if a
> route is reachable by doing:
>
> route -nq get 4.4.4.4 && echo "present"
OK bluhm@
> Index: route.c
> ===================================================================
> RCS file: /cvs/src/sbin/route/route.c,v
> retrieving revision 1.203
> diff -u -p -r1.203 route.c
> --- route.c 6 Sep 2017 20:21:22 -0000 1.203
> +++ route.c 16 Oct 2017 11:14:49 -0000
> @@ -674,11 +674,6 @@ newroute(int argc, char **argv)
> } else
> break;
> }
> - if (*cmd == 'g') {
> - if (ret != 0 && qflag == 0)
> - warn("writing to routing socket");
> - exit(0);
> - }
> oerrno = errno;
> if (!qflag) {
> printf("%s %s %s", cmd, ishost ? "host" : "net", dest);