diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2008-05-09 15:49:00 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2008-05-09 15:49:00 +0000 |
commit | 404394d58c3d296b13f44f2e3f72c1f7cc7fffbb (patch) | |
tree | 89bf6ed6b76ea074188c8fbe8dd52440f1f323ac /sys/netinet | |
parent | e2ba8b745514265f25b0060fb1e692dca7f05475 (diff) |
more rtrequest() to rtrequest1() replacement.
OK henning@
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/if_atm.c | 11 | ||||
-rw-r--r-- | sys/netinet/if_ether.c | 23 | ||||
-rw-r--r-- | sys/netinet/ip_icmp.c | 34 | ||||
-rw-r--r-- | sys/netinet/ip_spd.c | 15 |
4 files changed, 58 insertions, 25 deletions
diff --git a/sys/netinet/if_atm.c b/sys/netinet/if_atm.c index ffefcb7b8ce..ac78fda8ca2 100644 --- a/sys/netinet/if_atm.c +++ b/sys/netinet/if_atm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_atm.c,v 1.13 2006/06/17 10:22:06 henning Exp $ */ +/* $OpenBSD: if_atm.c,v 1.14 2008/05/09 15:48:59 claudio Exp $ */ /* * @@ -83,6 +83,7 @@ atm_rtrequest(req, rt, info) { struct sockaddr *gate = rt->rt_gateway; struct atm_pseudoioctl api; + struct rt_addrinfo info; #ifdef NATM struct sockaddr_in *sin; struct natmpcb *npcb = NULL; @@ -173,8 +174,12 @@ failed: rt->rt_flags &= ~RTF_LLINFO; } #endif - rtrequest(RTM_DELETE, rt_key(rt), (struct sockaddr *)0, - rt_mask(rt), 0, (struct rtentry **) 0, 0); + bzero(&info, sizeof(info)); + info.rti_flags = rt->rt_flags; + info.rti_info[RTAX_DST] = rt_key(rt); + info.rti_info[RTAX_NETMASK] = rt_mask(rt); + + rtrequest1(RTM_DELETE, &info, rt->rt_priority, NULL, 0); break; case RTM_DELETE: diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 5e4979d4c1c..77f4718a1b6 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.72 2008/05/09 07:32:39 henning Exp $ */ +/* $OpenBSD: if_ether.c,v 1.73 2008/05/09 15:48:59 claudio Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -752,6 +752,7 @@ arptfree(la) { struct rtentry *rt = la->la_rt; struct sockaddr_dl *sdl; + struct rt_addrinfo info; if (rt == 0) panic("arptfree"); @@ -762,8 +763,11 @@ arptfree(la) rt->rt_flags &= ~RTF_REJECT; return; } - rtrequest(RTM_DELETE, rt_key(rt), (struct sockaddr *)0, rt_mask(rt), - 0, (struct rtentry **)0, 0); + bzero(&info, sizeof(info)); + info.rti_info[RTAX_DST] = rt_key(rt); + info.rti_info[RTAX_NETMASK] = rt_mask(rt); + + rtrequest1(RTM_DELETE, &info, rt->rt_priority, NULL, 0); } /* @@ -791,10 +795,15 @@ arplookup(addr, create, proxy) if (create) { if (rt->rt_refcnt <= 0 && (rt->rt_flags & RTF_CLONED) != 0) { - rtrequest(RTM_DELETE, - (struct sockaddr *)rt_key(rt), - rt->rt_gateway, rt_mask(rt), rt->rt_flags, - 0, 0); + struct rt_addrinfo info; + + bzero(&info, sizeof(info)); + info.rti_info[RTAX_DST] = rt_key(rt); + info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; + info.rti_info[RTAX_NETMASK] = rt_mask(rt); + + rtrequest1(RTM_DELETE, &info, rt->rt_priority, + NULL, 0); } } return (0); diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 664a14cd0a6..e656ecdbc05 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_icmp.c,v 1.79 2008/02/05 22:57:31 mpf Exp $ */ +/* $OpenBSD: ip_icmp.c,v 1.80 2008/05/09 15:48:59 claudio Exp $ */ /* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */ /* @@ -869,11 +869,14 @@ icmp_mtudisc_clone(struct sockaddr *dst) if ((rt->rt_flags & RTF_HOST) == 0) { struct rtentry *nrt; + struct rt_addrinfo info; - error = rtrequest((int) RTM_ADD, dst, - (struct sockaddr *) rt->rt_gateway, - (struct sockaddr *) 0, - RTF_GATEWAY | RTF_HOST | RTF_DYNAMIC, &nrt, 0); + bzero(&info, sizeof(info)); + info.rti_info[RTAX_DST] = dst; + info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; + info.rti_flags = RTF_GATEWAY | RTF_HOST | RTF_DYNAMIC; + + error = rtrequest1(RTM_ADD, &info, RTP_DEFAULT, &nrt, 0); if (error) { rtfree(rt); return (NULL); @@ -965,10 +968,16 @@ icmp_mtudisc_timeout(struct rtentry *rt, struct rttimer *r) void *(*ctlfunc)(int, struct sockaddr *, void *); extern u_char ip_protox[]; struct sockaddr_in sa; + struct rt_addrinfo info; + + bzero(&info, sizeof(info)); + info.rti_info[RTAX_DST] = rt_key(rt); + info.rti_info[RTAX_NETMASK] = rt_mask(rt); + info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; + info.rti_flags = rt->rt_flags; sa = *(struct sockaddr_in *)rt_key(rt); - rtrequest((int) RTM_DELETE, (struct sockaddr *)rt_key(rt), - rt->rt_gateway, rt_mask(rt), rt->rt_flags, 0, 0); + rtrequest1(RTM_DELETE, &info, rt->rt_priority, NULL, 0); /* Notify TCP layer of increased Path MTU estimate */ ctlfunc = inetsw[ip_protox[IPPROTO_TCP]].pr_ctlinput; @@ -1008,7 +1017,14 @@ icmp_redirect_timeout(struct rtentry *rt, struct rttimer *r) panic("icmp_redirect_timeout: bad route to timeout"); if ((rt->rt_flags & (RTF_DYNAMIC | RTF_HOST)) == (RTF_DYNAMIC | RTF_HOST)) { - rtrequest((int) RTM_DELETE, (struct sockaddr *)rt_key(rt), - rt->rt_gateway, rt_mask(rt), rt->rt_flags, 0, 0); + struct rt_addrinfo info; + + bzero(&info, sizeof(info)); + info.rti_info[RTAX_DST] = rt_key(rt); + info.rti_info[RTAX_NETMASK] = rt_mask(rt); + info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; + info.rti_flags = rt->rt_flags; + + rtrequest1(RTM_DELETE, &info, rt->rt_priority, NULL, 0); } } diff --git a/sys/netinet/ip_spd.c b/sys/netinet/ip_spd.c index a58f7e0b03c..53870eb5ce4 100644 --- a/sys/netinet/ip_spd.c +++ b/sys/netinet/ip_spd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_spd.c,v 1.54 2007/09/01 18:49:28 henning Exp $ */ +/* $OpenBSD: ip_spd.c,v 1.55 2008/05/09 15:48:59 claudio Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) * @@ -565,6 +565,7 @@ ipsp_spd_lookup(struct mbuf *m, int af, int hlen, int *error, int direction, int ipsec_delete_policy(struct ipsec_policy *ipo) { + struct rt_addrinfo info; struct ipsec_acquire *ipa; int err = 0; @@ -572,12 +573,14 @@ ipsec_delete_policy(struct ipsec_policy *ipo) return 0; /* Delete from SPD. */ - if (!(ipo->ipo_flags & IPSP_POLICY_SOCKET)) - err = rtrequest(RTM_DELETE, (struct sockaddr *) &ipo->ipo_addr, - (struct sockaddr *) 0, - (struct sockaddr *) &ipo->ipo_mask, - 0, (struct rtentry **) 0, 0); /* XXX other tables? */ + if (!(ipo->ipo_flags & IPSP_POLICY_SOCKET)) { + bzero(&info, sizeof(info)); + info.rti_info[RTAX_DST] = (struct sockaddr *)&ipo->ipo_addr; + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&ipo->ipo_mask; + /* XXX other tables? */ + err = rtrequest1(RTM_DELETE, &info, RTP_DEFAULT, NULL, 0); + } if (ipo->ipo_tdb != NULL) TAILQ_REMOVE(&ipo->ipo_tdb->tdb_policy_head, ipo, ipo_tdb_next); |