get userland notification for free.
ok blambert@, bluhm@
-/* $OpenBSD: ip_icmp.c,v 1.129 2014/12/22 11:05:53 mpi Exp $ */
+/* $OpenBSD: ip_icmp.c,v 1.130 2015/01/26 11:38:37 mpi Exp $ */
/* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */
/*
(RTF_DYNAMIC | RTF_HOST)) {
void *(*ctlfunc)(int, struct sockaddr *, u_int, void *);
struct sockaddr_in sa;
- struct rt_addrinfo info;
int s;
- memset(&info, 0, 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);
s = splsoftnet();
- rtrequest1(RTM_DELETE, &info, rt->rt_priority, NULL,
- r->rtt_tableid);
+ rtdeletemsg(rt, r->rtt_tableid);
/* Notify TCP layer of increased Path MTU estimate */
ctlfunc = inetsw[ip_protox[IPPROTO_TCP]].pr_ctlinput;
if ((rt->rt_flags & (RTF_DYNAMIC | RTF_HOST)) ==
(RTF_DYNAMIC | RTF_HOST)) {
- struct rt_addrinfo info;
int s;
- memset(&info, 0, 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;
-
s = splsoftnet();
- rtrequest1(RTM_DELETE, &info, rt->rt_priority, NULL,
- r->rtt_tableid);
+ rtdeletemsg(rt, r->rtt_tableid);
splx(s);
}
}
-/* $OpenBSD: icmp6.c,v 1.153 2015/01/19 13:53:55 mpi Exp $ */
+/* $OpenBSD: icmp6.c,v 1.154 2015/01/26 11:38:37 mpi Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
panic("icmp6_mtudisc_timeout: bad route to timeout");
if ((rt->rt_flags & (RTF_DYNAMIC | RTF_HOST)) ==
(RTF_DYNAMIC | RTF_HOST)) {
- struct rt_addrinfo info;
int s;
- bzero(&info, sizeof(info));
- info.rti_flags = rt->rt_flags;
- info.rti_info[RTAX_DST] = rt_key(rt);
- info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
- info.rti_info[RTAX_NETMASK] = rt_mask(rt);
-
s = splsoftnet();
- rtrequest1(RTM_DELETE, &info, rt->rt_priority, NULL,
- r->rtt_tableid);
+ rtdeletemsg(rt, r->rtt_tableid);
splx(s);
} else {
if (!(rt->rt_rmx.rmx_locks & RTV_MTU))
panic("icmp6_redirect_timeout: bad route to timeout");
if ((rt->rt_flags & (RTF_GATEWAY | RTF_DYNAMIC | RTF_HOST)) ==
(RTF_GATEWAY | RTF_DYNAMIC | RTF_HOST)) {
- struct rt_addrinfo info;
int s;
- bzero(&info, sizeof(info));
- info.rti_flags = rt->rt_flags;
- info.rti_info[RTAX_DST] = rt_key(rt);
- info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
- info.rti_info[RTAX_NETMASK] = rt_mask(rt);
-
s = splsoftnet();
- rtrequest1(RTM_DELETE, &info, rt->rt_priority, NULL,
- r->rtt_tableid);
+ rtdeletemsg(rt, r->rtt_tableid);
splx(s);
}
}
-/* $OpenBSD: in6_ifattach.c,v 1.81 2015/01/10 11:43:37 mpi Exp $ */
+/* $OpenBSD: in6_ifattach.c,v 1.82 2015/01/26 11:38:37 mpi Exp $ */
/* $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $ */
/*
sin6.sin6_addr.s6_addr16[1] = htons(ifp->if_index);
rt = rtalloc(sin6tosa(&sin6), 0, ifp->if_rdomain);
if (rt && rt->rt_ifp == ifp) {
- struct rt_addrinfo info;
-
- bzero(&info, sizeof(info));
- info.rti_flags = rt->rt_flags;
- 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,
- ifp->if_rdomain);
+ rtdeletemsg(rt, ifp->if_rdomain);
rtfree(rt);
}
sin6.sin6_addr.s6_addr16[1] = htons(ifp->if_index);
rt = rtalloc(sin6tosa(&sin6), 0, ifp->if_rdomain);
if (rt && rt->rt_ifp == ifp) {
- struct rt_addrinfo info;
-
- bzero(&info, sizeof(info));
- info.rti_flags = rt->rt_flags;
- 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,
- ifp->if_rdomain);
+ rtdeletemsg(rt, ifp->if_rdomain);
rtfree(rt);
}