summaryrefslogtreecommitdiff
path: root/sys/net/pfkeyv2.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2008-05-09 15:48:16 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2008-05-09 15:48:16 +0000
commite2ba8b745514265f25b0060fb1e692dca7f05475 (patch)
tree7871ba0cdf4da912a55a7a93b812744c0b6f7ccf /sys/net/pfkeyv2.c
parent7feb1ee395340d36c066ad3ba49948799a9d3614 (diff)
replace rtrequest() with corresponding rtrequest1() replacement.
OK henning@
Diffstat (limited to 'sys/net/pfkeyv2.c')
-rw-r--r--sys/net/pfkeyv2.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c
index e5e6bbf559a..3b666a9ed68 100644
--- a/sys/net/pfkeyv2.c
+++ b/sys/net/pfkeyv2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkeyv2.c,v 1.118 2007/11/24 12:59:28 jmc Exp $ */
+/* $OpenBSD: pfkeyv2.c,v 1.119 2008/05/09 15:48:15 claudio Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
@@ -1723,12 +1723,17 @@ pfkeyv2_send(struct socket *socket, void *message, int len)
/* Flow type */
if (!exists) {
/* Add SPD entry */
- if ((rval = rtrequest(RTM_ADD,
- (struct sockaddr *) &encapdst,
- (struct sockaddr *) &encapgw,
- (struct sockaddr *) &encapnetmask,
- RTF_UP | RTF_GATEWAY | RTF_STATIC,
- (struct rtentry **) 0, 0)) != 0) {
+ struct rt_addrinfo info;
+
+ bzero(&info, sizeof(info));
+ info.rti_info[RTAX_DST] = (struct sockaddr *)&encapdst;
+ info.rti_info[RTAX_GATEWAY] =
+ (struct sockaddr *)&encapgw;
+ info.rti_info[RTAX_NETMASK] =
+ (struct sockaddr *)&encapnetmask;
+ info.rti_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC;
+ if ((rval = rtrequest1(RTM_ADD, &info, RTP_DEFAULT,
+ NULL, 0)) != 0) {
/* Remove from linked list of policies on TDB */
if (ipo->ipo_tdb)
TAILQ_REMOVE(&ipo->ipo_tdb->tdb_policy_head,