-/* $OpenBSD: if_mpe.c,v 1.40 2014/12/19 17:14:39 tedu Exp $ */
+/* $OpenBSD: if_mpe.c,v 1.41 2014/12/22 11:05:53 mpi Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@spootnik.org>
int
mpeioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
- int error;
struct mpe_softc *ifm;
struct ifreq *ifr;
struct shim_hdr shim;
+ int s, error = 0;
ifr = (struct ifreq *)data;
- error = 0;
switch (cmd) {
case SIOCSIFADDR:
if (!ISSET(ifp->if_flags, IFF_UP))
if (error)
break;
ifm = ifp->if_softc;
+ s = splsoftnet();
if (ifm->sc_shim.shim_label) {
/* remove old MPLS route */
mpe_newlabel(ifp, RTM_DELETE, &ifm->sc_shim);
}
/* add new MPLS route */
error = mpe_newlabel(ifp, RTM_ADD, &shim);
+ splx(s);
if (error)
break;
ifm->sc_shim.shim_label = shim.shim_label;
if (ifr->ifr_rdomainid != ifp->if_rdomain) {
if (ifm->sc_shim.shim_label) {
shim.shim_label = ifm->sc_shim.shim_label;
+ s = splsoftnet();
error = mpe_newlabel(ifp, RTM_ADD, &shim);
+ splx(s);
}
}
/* return with ENOTTY so that the parent handler finishes */
-/* $OpenBSD: ip_icmp.c,v 1.128 2014/12/08 10:51:00 mpi Exp $ */
+/* $OpenBSD: ip_icmp.c,v 1.129 2014/12/22 11:05:53 mpi Exp $ */
/* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */
/*
{
if (rt == NULL)
panic("icmp_mtudisc_timeout: bad route to timeout");
+
if ((rt->rt_flags & (RTF_DYNAMIC | RTF_HOST)) ==
(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_flags = rt->rt_flags;
sa = *(struct sockaddr_in *)rt_key(rt);
+
+ s = splsoftnet();
rtrequest1(RTM_DELETE, &info, rt->rt_priority, NULL,
r->rtt_tableid);
if (ctlfunc)
(*ctlfunc)(PRC_MTUINC,(struct sockaddr *)&sa,
r->rtt_tableid, NULL);
+ splx(s);
} else
if ((rt->rt_rmx.rmx_locks & RTV_MTU) == 0)
rt->rt_rmx.rmx_mtu = 0;
{
if (rt == NULL)
panic("icmp_redirect_timeout: bad route to timeout");
+
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_GATEWAY] = rt->rt_gateway;
info.rti_flags = rt->rt_flags;
+ s = splsoftnet();
rtrequest1(RTM_DELETE, &info, rt->rt_priority, NULL,
r->rtt_tableid);
+ splx(s);
}
}
-/* $OpenBSD: icmp6.c,v 1.151 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: icmp6.c,v 1.152 2014/12/22 11:05:53 mpi Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
if ((rt->rt_flags & RTF_HOST) == 0) {
struct rt_addrinfo info;
struct rtentry *nrt;
+ int s;
bzero(&info, sizeof(info));
info.rti_flags = RTF_GATEWAY | RTF_HOST | RTF_DYNAMIC;
info.rti_info[RTAX_DST] = dst;
info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
+
+ s = splsoftnet();
error = rtrequest1(RTM_ADD, &info, rt->rt_priority, &nrt,
rdomain);
+ splx(s);
if (error) {
rtfree(rt);
return NULL;
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);
+ splx(s);
} else {
if (!(rt->rt_rmx.rmx_locks & RTV_MTU))
rt->rt_rmx.rmx_mtu = 0;
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);
+ splx(s);
}
}
-/* $OpenBSD: nd6.c,v 1.127 2014/11/20 13:54:24 mpi Exp $ */
+/* $OpenBSD: nd6.c,v 1.128 2014/12/22 11:05:53 mpi Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
struct llinfo_nd6 *ln = (struct llinfo_nd6 *)rt->rt_llinfo, *next;
struct in6_addr in6 = satosin6(rt_key(rt))->sin6_addr;
struct nd_defrouter *dr;
+ int s;
/*
* we used to have pfctlinput(PRC_HOSTDEAD) here.
* even though it is not harmful, it was not really necessary.
*/
+ s = splsoftnet();
if (!ip6_forwarding) {
- int s;
- s = splsoftnet();
dr = defrouter_lookup(&satosin6(rt_key(rt))->sin6_addr,
rt->rt_ifp);
*/
defrouter_select();
}
- splx(s);
}
/*
info.rti_info[RTAX_NETMASK] = rt_mask(rt);
rtrequest1(RTM_DELETE, &info, rt->rt_priority, NULL,
rt->rt_ifp->if_rdomain);
+ splx(s);
return (next);
}
-/* $OpenBSD: nd6_rtr.c,v 1.94 2014/12/17 09:57:13 mpi Exp $ */
+/* $OpenBSD: nd6_rtr.c,v 1.95 2014/12/22 11:05:53 mpi Exp $ */
/* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */
/*
log(LOG_WARNING, "prelist_remove: negative count on %s\n",
pr->ndpr_ifp->if_xname);
}
- splx(s);
free(pr, M_IP6NDP, 0);
pfxlist_onlink_check();
+ splx(s);
}
/*