-/* $OpenBSD: route.c,v 1.407 2022/04/28 17:47:41 bluhm Exp $ */
+/* $OpenBSD: route.c,v 1.408 2022/04/30 07:20:35 claudio Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
#define RTTIMER_CALLOUT(r) { \
if (r->rtt_func != NULL) { \
- (*r->rtt_func)(r->rtt_rt, r); \
+ (*r->rtt_func)(r->rtt_rt, r->rtt_tableid); \
} else { \
struct ifnet *ifp; \
\
ifp = if_get(r->rtt_rt->rt_ifidx); \
- if (ifp != NULL) \
+ if (ifp != NULL && \
+ (r->rtt_rt->rt_flags & (RTF_DYNAMIC|RTF_HOST)) == \
+ (RTF_DYNAMIC|RTF_HOST)) \
rtdeletemsg(r->rtt_rt, ifp, r->rtt_tableid); \
if_put(ifp); \
} \
}
int
-rt_timer_add(struct rtentry *rt, void (*func)(struct rtentry *,
- struct rttimer *), struct rttimer_queue *queue, u_int rtableid)
+rt_timer_add(struct rtentry *rt, void (*func)(struct rtentry *, u_int),
+ struct rttimer_queue *queue, u_int rtableid)
{
struct rttimer *r, *rnew;
time_t current_time;
-/* $OpenBSD: route.h,v 1.191 2022/04/28 17:47:41 bluhm Exp $ */
+/* $OpenBSD: route.h,v 1.192 2022/04/30 07:20:35 claudio Exp $ */
/* $NetBSD: route.h,v 1.9 1996/02/13 22:00:49 christos Exp $ */
/*
struct rttimer_queue *rtt_queue; /* [T] back pointer to queue */
struct rtentry *rtt_rt; /* [I] back pointer to route */
void (*rtt_func) /* [I] callback */
- (struct rtentry *, struct rttimer *);
+ (struct rtentry *, u_int);
time_t rtt_time; /* [I] when timer registered */
u_int rtt_tableid; /* [I] rtable id of rtt_rt */
};
void rt_timer_init(void);
int rt_timer_add(struct rtentry *,
- void(*)(struct rtentry *, struct rttimer *),
+ void(*)(struct rtentry *, u_int),
struct rttimer_queue *, u_int);
void rt_timer_remove_all(struct rtentry *);
struct rttimer_queue *rt_timer_queue_create(int);
-/* $OpenBSD: ip_icmp.c,v 1.188 2022/04/20 09:38:26 bluhm Exp $ */
+/* $OpenBSD: ip_icmp.c,v 1.189 2022/04/30 07:20:35 claudio Exp $ */
/* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */
/*
};
-void icmp_mtudisc_timeout(struct rtentry *, struct rttimer *);
+void icmp_mtudisc_timeout(struct rtentry *, u_int);
int icmp_ratelimit(const struct in_addr *, const int, const int);
-void icmp_redirect_timeout(struct rtentry *, struct rttimer *);
int icmp_input_if(struct ifnet *, struct mbuf **, int *, int, int);
int icmp_sysctl_icmpstat(void *, size_t *, void *);
rtredirect(sintosa(&sdst), sintosa(&sgw),
sintosa(&ssrc), &newrt, m->m_pkthdr.ph_rtableid);
if (newrt != NULL && icmp_redirtimeout > 0) {
- rt_timer_add(newrt, icmp_redirect_timeout,
- icmp_redirect_timeout_q, m->m_pkthdr.ph_rtableid);
+ rt_timer_add(newrt, NULL, icmp_redirect_timeout_q,
+ m->m_pkthdr.ph_rtableid);
}
rtfree(newrt);
pfctlinput(PRC_REDIRECT_HOST, sintosa(&sdst));
}
void
-icmp_mtudisc_timeout(struct rtentry *rt, struct rttimer *r)
+icmp_mtudisc_timeout(struct rtentry *rt, u_int rtableid)
{
struct ifnet *ifp;
sin = *satosin(rt_key(rt));
- rtdeletemsg(rt, ifp, r->rtt_tableid);
+ rtdeletemsg(rt, ifp, rtableid);
/* Notify TCP layer of increased Path MTU estimate */
ctlfunc = inetsw[ip_protox[IPPROTO_TCP]].pr_ctlinput;
if (ctlfunc)
(*ctlfunc)(PRC_MTUINC, sintosa(&sin),
- r->rtt_tableid, NULL);
+ rtableid, NULL);
} else {
if ((rt->rt_locks & RTV_MTU) == 0)
rt->rt_mtu = 0;
return 0; /* okay to send */
}
-void
-icmp_redirect_timeout(struct rtentry *rt, struct rttimer *r)
-{
- struct ifnet *ifp;
-
- NET_ASSERT_LOCKED();
-
- ifp = if_get(rt->rt_ifidx);
- if (ifp == NULL)
- return;
-
- if ((rt->rt_flags & (RTF_DYNAMIC|RTF_HOST)) == (RTF_DYNAMIC|RTF_HOST)) {
- rtdeletemsg(rt, ifp, r->rtt_tableid);
- }
-
- if_put(ifp);
-}
-
int
icmp_do_exthdr(struct mbuf *m, u_int16_t class, u_int8_t ctype, void *buf,
size_t len)
-/* $OpenBSD: ip_mroute.c,v 1.132 2022/04/28 17:27:14 claudio Exp $ */
+/* $OpenBSD: ip_mroute.c,v 1.133 2022/04/30 07:20:35 claudio Exp $ */
/* $NetBSD: ip_mroute.c,v 1.85 2004/04/26 01:31:57 matt Exp $ */
/*
int add_vif(struct socket *, struct mbuf *);
int del_vif(struct socket *, struct mbuf *);
void update_mfc_params(struct mfcctl2 *, int, unsigned int);
-void mfc_expire_route(struct rtentry *, struct rttimer *);
+void mfc_expire_route(struct rtentry *, u_int);
int mfc_add(struct mfcctl2 *, struct in_addr *, struct in_addr *,
int, unsigned int, int);
int add_mfc(struct socket *, struct mbuf *);
}
void
-mfc_expire_route(struct rtentry *rt, struct rttimer *rtt)
+mfc_expire_route(struct rtentry *rt, u_int rtableid)
{
struct mfc *mfc = (struct mfc *)rt->rt_llinfo;
- unsigned int rtableid = rtt->rtt_tableid;
/* Skip entry being deleted. */
if (mfc == NULL)
-/* $OpenBSD: icmp6.c,v 1.239 2022/04/20 09:38:26 bluhm Exp $ */
+/* $OpenBSD: icmp6.c,v 1.240 2022/04/30 07:20:35 claudio Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
const char *icmp6_redirect_diag(struct in6_addr *, struct in6_addr *,
struct in6_addr *);
int icmp6_notify_error(struct mbuf *, int, int, int);
-void icmp6_mtudisc_timeout(struct rtentry *, struct rttimer *);
-void icmp6_redirect_timeout(struct rtentry *, struct rttimer *);
+void icmp6_mtudisc_timeout(struct rtentry *, u_int);
void
icmp6_init(void)
rtredirect(sin6tosa(&sdst), sin6tosa(&sgw), sin6tosa(&ssrc),
&newrt, m->m_pkthdr.ph_rtableid);
if (newrt != NULL && icmp6_redirtimeout > 0) {
- rt_timer_add(newrt, icmp6_redirect_timeout,
- icmp6_redirect_timeout_q, m->m_pkthdr.ph_rtableid);
+ rt_timer_add(newrt, NULL, icmp6_redirect_timeout_q,
+ m->m_pkthdr.ph_rtableid);
}
rtfree(newrt);
}
}
void
-icmp6_mtudisc_timeout(struct rtentry *rt, struct rttimer *r)
+icmp6_mtudisc_timeout(struct rtentry *rt, u_int rtableid)
{
struct ifnet *ifp;
return;
if ((rt->rt_flags & (RTF_DYNAMIC|RTF_HOST)) == (RTF_DYNAMIC|RTF_HOST)) {
- rtdeletemsg(rt, ifp, r->rtt_tableid);
+ rtdeletemsg(rt, ifp, rtableid);
} else {
if (!(rt->rt_locks & RTV_MTU))
rt->rt_mtu = 0;
if_put(ifp);
}
-void
-icmp6_redirect_timeout(struct rtentry *rt, struct rttimer *r)
-{
- struct ifnet *ifp;
-
- NET_ASSERT_LOCKED();
-
- ifp = if_get(rt->rt_ifidx);
- if (ifp == NULL)
- return;
-
- if ((rt->rt_flags & (RTF_DYNAMIC|RTF_HOST)) == (RTF_DYNAMIC|RTF_HOST)) {
- rtdeletemsg(rt, ifp, r->rtt_tableid);
- }
-
- if_put(ifp);
-}
-
const struct sysctl_bounded_args icmpv6ctl_vars[] = {
{ ICMPV6CTL_ND6_DELAY, &nd6_delay, 0, INT_MAX },
{ ICMPV6CTL_ND6_UMAXTRIES, &nd6_umaxtries, 0, INT_MAX },
-/* $OpenBSD: ip6_mroute.c,v 1.128 2022/04/28 17:27:14 claudio Exp $ */
+/* $OpenBSD: ip6_mroute.c,v 1.129 2022/04/30 07:20:35 claudio Exp $ */
/* $NetBSD: ip6_mroute.c,v 1.59 2003/12/10 09:28:38 itojun Exp $ */
/* $KAME: ip6_mroute.c,v 1.45 2001/03/25 08:38:51 itojun Exp $ */
struct rtentry *mrt6_mcast_add(struct ifnet *, struct sockaddr *,
struct sockaddr *);
void mrt6_mcast_del(struct rtentry *, unsigned int);
-void mf6c_expire_route(struct rtentry *, struct rttimer *);
+void mf6c_expire_route(struct rtentry *, u_int);
/*
* Handle MRT setsockopt commands to modify the multicast routing tables.
}
void
-mf6c_expire_route(struct rtentry *rt, struct rttimer *rtt)
+mf6c_expire_route(struct rtentry *rt, u_int rtableid)
{
struct mf6c *mf6c = (struct mf6c *)rt->rt_llinfo;
- unsigned int rtableid = rtt->rtt_tableid;
#ifdef MCAST_DEBUG
char bsrc[INET6_ADDRSTRLEN], bdst[INET6_ADDRSTRLEN];
#endif /* MCAST_DEBUG */