summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsthen <sthen@openbsd.org>2011-04-25 11:14:37 +0000
committersthen <sthen@openbsd.org>2011-04-25 11:14:37 +0000
commit29795d6f7f54a19836a06badd53223d778abf4d4 (patch)
tree3e5d4a03af12a0c37f938593e11e62bb1c2d2eeb
parenthtc desire works too. (diff)
downloadwireguard-openbsd-29795d6f7f54a19836a06badd53223d778abf4d4.tar.xz
wireguard-openbsd-29795d6f7f54a19836a06badd53223d778abf4d4.zip
allow commands like "route add 0.0.0.0/1 $SOMEHOST" to work correctly,
previously they operated on the default route. reported by weerd@, ok claudio@
-rw-r--r--sbin/route/route.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index f4a541ebde2..eb427e3beeb 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.152 2010/10/25 19:39:55 deraadt Exp $ */
+/* $OpenBSD: route.c,v 1.153 2011/04/25 11:14:37 sthen Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
@@ -704,7 +704,7 @@ inet_makenetandmask(u_int32_t net, struct sockaddr_in *sin, int bits)
char *cp;
rtm_addrs |= RTA_NETMASK;
- if (net == 0)
+ if (net == 0 && bits == 0)
mask = addr = 0;
else if (bits) {
addr = net;