summaryrefslogtreecommitdiff
path: root/sys/net/route.c
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2006-05-04 18:33:37 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2006-05-04 18:33:37 +0000
commitac4a76ebc9e82101420f97ce7f3020060018b7de (patch)
tree07a972225353a42bafe42b272f8bdba1892afd61 /sys/net/route.c
parentee40c7aa76b2e91bd0699e6229aaf7593efcf2c8 (diff)
downloadsrc-test2-ac4a76ebc9e82101420f97ce7f3020060018b7de.tar.gz
src-test2-ac4a76ebc9e82101420f97ce7f3020060018b7de.zip
Notes
Diffstat (limited to 'sys/net/route.c')
-rw-r--r--sys/net/route.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index 94d6c2447f8a..ebfc640ff328 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -499,6 +499,9 @@ rtrequest(int req,
{
struct rt_addrinfo info;
+ if (dst->sa_len == 0)
+ return(EINVAL);
+
bzero((caddr_t)&info, sizeof(info));
info.rti_flags = flags;
info.rti_info[RTAX_DST] = dst;
@@ -1137,6 +1140,9 @@ rtinit(struct ifaddr *ifa, int cmd, int flags)
dst = ifa->ifa_addr;
netmask = ifa->ifa_netmask;
}
+ if (dst->sa_len == 0)
+ return(EINVAL);
+
/*
* If it's a delete, check that if it exists, it's on the correct
* interface or we might scrub a route to another ifa which would