summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2008-05-09 15:50:52 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2008-05-09 15:50:52 +0000
commit1eb793007dd46008bcb26115138b4d44cffc4644 (patch)
tree1a8b2f3f100ba16e50d11955af05b40ee76adbd9 /sys
parent404394d58c3d296b13f44f2e3f72c1f7cc7fffbb (diff)
Another rtrequest() rtrequest1() replacement.
OK henning@
Diffstat (limited to 'sys')
-rw-r--r--sys/nfs/nfs_boot.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/nfs/nfs_boot.c b/sys/nfs/nfs_boot.c
index f1a3c241673..ec6ec9a31f4 100644
--- a/sys/nfs/nfs_boot.c
+++ b/sys/nfs/nfs_boot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_boot.c,v 1.20 2008/03/31 22:27:43 deraadt Exp $ */
+/* $OpenBSD: nfs_boot.c,v 1.21 2008/05/09 15:50:51 claudio Exp $ */
/* $NetBSD: nfs_boot.c,v 1.26 1996/05/07 02:51:25 thorpej Exp $ */
/*
@@ -230,6 +230,7 @@ nfs_boot_init(nd, procp)
*/
if (gw_ip.s_addr) {
struct sockaddr dst, gw, mask;
+ struct rt_addrinfo info;
/* Destination: (default) */
bzero((caddr_t)&dst, sizeof(dst));
dst.sa_len = sizeof(dst);
@@ -242,11 +243,15 @@ nfs_boot_init(nd, procp)
sin->sin_addr.s_addr = gw_ip.s_addr;
/* Mask: (zero length) */
bzero(&mask, sizeof(mask));
+ bzero(&info, sizeof(info));
+ info.rti_info[RTAX_DST] = &dst;
+ info.rti_info[RTAX_GATEWAY] = &gw;
+ info.rti_info[RTAX_NETMASK] = &mask;
+ info.rti_flags = (RTF_UP | RTF_GATEWAY | RTF_STATIC);
printf("nfs_boot: gateway=%s\n", inet_ntoa(gw_ip));
/* add, dest, gw, mask, flags, 0 */
- error = rtrequest(RTM_ADD, &dst, (struct sockaddr *)&gw,
- &mask, (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL, 0);
+ error = rtrequest(RTM_ADD, &info, RTP_STATIC, NULL, 0);
if (error)
printf("nfs_boot: add route, error=%d\n", error);
}