sync with OpenBSD -current
This commit is contained in:
parent
382ecd9441
commit
1b576c8ddf
25 changed files with 517 additions and 395 deletions
|
@ -1,7 +1,7 @@
|
|||
/* $OpenBSD: spleen32x64.h,v 1.9 2020/07/31 20:14:47 fcambus Exp $ */
|
||||
/* $OpenBSD: spleen32x64.h,v 1.10 2024/04/16 17:15:15 fcambus Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2018-2020 Frederic Cambus <fcambus@openbsd.org>
|
||||
* Copyright (c) 2018-2024 Frederic Cambus <fcambus@openbsd.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -5616,11 +5616,11 @@ static u_char spleen32x64_data[] = {
|
|||
0x0f, 0x00, 0x00, 0xf0, /* ....****................****.... */
|
||||
0x0f, 0x00, 0x00, 0xf0, /* ....****................****.... */
|
||||
0x0f, 0x80, 0x00, 0xf0, /* ....*****...............****.... */
|
||||
0x0f, 0xc0, 0x00, 0xf0, /* ....******..............****.... */
|
||||
0x07, 0xc0, 0x00, 0xf0, /* .....*****..............****.... */
|
||||
0x07, 0xff, 0xff, 0xf0, /* .....***********************.... */
|
||||
0x03, 0xff, 0xff, 0xf0, /* ......**********************.... */
|
||||
0x01, 0xff, 0xff, 0xf0, /* .......*********************.... */
|
||||
0x00, 0xff, 0xff, 0xf0, /* ........********************.... */
|
||||
0x00, 0x7f, 0xff, 0xf0, /* .........*******************.... */
|
||||
0x00, 0x00, 0x00, 0x00, /* ................................ */
|
||||
0x00, 0x00, 0x00, 0x00, /* ................................ */
|
||||
0x00, 0x00, 0x00, 0x00, /* ................................ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ip_input.c,v 1.392 2024/04/14 20:46:27 bluhm Exp $ */
|
||||
/* $OpenBSD: ip_input.c,v 1.393 2024/04/16 12:56:39 bluhm Exp $ */
|
||||
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -138,7 +138,7 @@ extern struct niqueue arpinq;
|
|||
|
||||
int ip_ours(struct mbuf **, int *, int, int);
|
||||
int ip_dooptions(struct mbuf *, struct ifnet *);
|
||||
int in_ouraddr(struct mbuf *, struct ifnet *, struct rtentry **);
|
||||
int in_ouraddr(struct mbuf *, struct ifnet *, struct route *);
|
||||
|
||||
int ip_fragcheck(struct mbuf **, int *);
|
||||
struct mbuf * ip_reass(struct ipqent *, struct ipq *);
|
||||
|
@ -424,9 +424,9 @@ bad:
|
|||
int
|
||||
ip_input_if(struct mbuf **mp, int *offp, int nxt, int af, struct ifnet *ifp)
|
||||
{
|
||||
struct mbuf *m;
|
||||
struct rtentry *rt = NULL;
|
||||
struct ip *ip;
|
||||
struct route ro;
|
||||
struct mbuf *m;
|
||||
struct ip *ip;
|
||||
int hlen;
|
||||
#if NPF > 0
|
||||
struct in_addr odst;
|
||||
|
@ -435,6 +435,7 @@ ip_input_if(struct mbuf **mp, int *offp, int nxt, int af, struct ifnet *ifp)
|
|||
|
||||
KASSERT(*offp == 0);
|
||||
|
||||
ro.ro_rt = NULL;
|
||||
ipstat_inc(ips_total);
|
||||
m = *mp = ipv4_check(ifp, *mp);
|
||||
if (m == NULL)
|
||||
|
@ -482,7 +483,7 @@ ip_input_if(struct mbuf **mp, int *offp, int nxt, int af, struct ifnet *ifp)
|
|||
goto out;
|
||||
}
|
||||
|
||||
switch(in_ouraddr(m, ifp, &rt)) {
|
||||
switch(in_ouraddr(m, ifp, &ro)) {
|
||||
case 2:
|
||||
goto bad;
|
||||
case 1:
|
||||
|
@ -584,14 +585,14 @@ ip_input_if(struct mbuf **mp, int *offp, int nxt, int af, struct ifnet *ifp)
|
|||
}
|
||||
#endif /* IPSEC */
|
||||
|
||||
ip_forward(m, ifp, rt, pfrdr);
|
||||
ip_forward(m, ifp, &ro, pfrdr);
|
||||
*mp = NULL;
|
||||
return IPPROTO_DONE;
|
||||
bad:
|
||||
nxt = IPPROTO_DONE;
|
||||
m_freemp(mp);
|
||||
out:
|
||||
rtfree(rt);
|
||||
rtfree(ro.ro_rt);
|
||||
return nxt;
|
||||
}
|
||||
|
||||
|
@ -805,11 +806,10 @@ ip_deliver(struct mbuf **mp, int *offp, int nxt, int af, int shared)
|
|||
#undef IPSTAT_INC
|
||||
|
||||
int
|
||||
in_ouraddr(struct mbuf *m, struct ifnet *ifp, struct rtentry **prt)
|
||||
in_ouraddr(struct mbuf *m, struct ifnet *ifp, struct route *ro)
|
||||
{
|
||||
struct rtentry *rt;
|
||||
struct ip *ip;
|
||||
struct sockaddr_in sin;
|
||||
int match = 0;
|
||||
|
||||
#if NPF > 0
|
||||
|
@ -826,13 +826,8 @@ in_ouraddr(struct mbuf *m, struct ifnet *ifp, struct rtentry **prt)
|
|||
|
||||
ip = mtod(m, struct ip *);
|
||||
|
||||
memset(&sin, 0, sizeof(sin));
|
||||
sin.sin_len = sizeof(sin);
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_addr = ip->ip_dst;
|
||||
rt = rtalloc_mpath(sintosa(&sin), &ip->ip_src.s_addr,
|
||||
m->m_pkthdr.ph_rtableid);
|
||||
if (rtisvalid(rt)) {
|
||||
rt = route_mpath(ro, &ip->ip_dst, &ip->ip_src, m->m_pkthdr.ph_rtableid);
|
||||
if (rt != NULL) {
|
||||
if (ISSET(rt->rt_flags, RTF_LOCAL))
|
||||
match = 1;
|
||||
|
||||
|
@ -848,7 +843,6 @@ in_ouraddr(struct mbuf *m, struct ifnet *ifp, struct rtentry **prt)
|
|||
m->m_flags |= M_BCAST;
|
||||
}
|
||||
}
|
||||
*prt = rt;
|
||||
|
||||
if (!match) {
|
||||
struct ifaddr *ifa;
|
||||
|
@ -1527,11 +1521,12 @@ const u_char inetctlerrmap[PRC_NCMDS] = {
|
|||
* via a source route.
|
||||
*/
|
||||
void
|
||||
ip_forward(struct mbuf *m, struct ifnet *ifp, struct rtentry *rt, int srcrt)
|
||||
ip_forward(struct mbuf *m, struct ifnet *ifp, struct route *ro, int srcrt)
|
||||
{
|
||||
struct mbuf mfake, *mcopy;
|
||||
struct ip *ip = mtod(m, struct ip *);
|
||||
struct route ro;
|
||||
struct route iproute;
|
||||
struct rtentry *rt;
|
||||
int error = 0, type = 0, code = 0, destmtu = 0, fake = 0, len;
|
||||
u_int32_t dest;
|
||||
|
||||
|
@ -1546,19 +1541,16 @@ ip_forward(struct mbuf *m, struct ifnet *ifp, struct rtentry *rt, int srcrt)
|
|||
goto done;
|
||||
}
|
||||
|
||||
ro.ro_rt = NULL;
|
||||
route_cache(&ro, &ip->ip_dst, &ip->ip_src, m->m_pkthdr.ph_rtableid);
|
||||
if (!rtisvalid(rt)) {
|
||||
rtfree(rt);
|
||||
rt = rtalloc_mpath(&ro.ro_dstsa, &ip->ip_src.s_addr,
|
||||
m->m_pkthdr.ph_rtableid);
|
||||
if (rt == NULL) {
|
||||
ipstat_inc(ips_noroute);
|
||||
icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, dest, 0);
|
||||
return;
|
||||
}
|
||||
if (ro == NULL) {
|
||||
ro = &iproute;
|
||||
ro->ro_rt = NULL;
|
||||
}
|
||||
rt = route_mpath(ro, &ip->ip_dst, &ip->ip_src, m->m_pkthdr.ph_rtableid);
|
||||
if (rt == NULL) {
|
||||
ipstat_inc(ips_noroute);
|
||||
icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, dest, 0);
|
||||
goto done;
|
||||
}
|
||||
ro.ro_rt = rt;
|
||||
|
||||
/*
|
||||
* Save at most 68 bytes of the packet in case
|
||||
|
@ -1609,10 +1601,10 @@ ip_forward(struct mbuf *m, struct ifnet *ifp, struct rtentry *rt, int srcrt)
|
|||
}
|
||||
}
|
||||
|
||||
error = ip_output(m, NULL, &ro,
|
||||
error = ip_output(m, NULL, ro,
|
||||
(IP_FORWARDING | (ip_directedbcast ? IP_ALLOWBROADCAST : 0)),
|
||||
NULL, NULL, 0);
|
||||
rt = ro.ro_rt;
|
||||
rt = ro->ro_rt;
|
||||
if (error)
|
||||
ipstat_inc(ips_cantforward);
|
||||
else {
|
||||
|
@ -1680,9 +1672,10 @@ ip_forward(struct mbuf *m, struct ifnet *ifp, struct rtentry *rt, int srcrt)
|
|||
icmp_error(mcopy, type, code, dest, destmtu);
|
||||
|
||||
done:
|
||||
if (ro == &iproute)
|
||||
rtfree(ro->ro_rt);
|
||||
if (fake)
|
||||
m_tag_delete_chain(&mfake);
|
||||
rtfree(rt);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ip_var.h,v 1.115 2024/04/14 20:46:27 bluhm Exp $ */
|
||||
/* $OpenBSD: ip_var.h,v 1.116 2024/04/16 12:56:39 bluhm Exp $ */
|
||||
/* $NetBSD: ip_var.h,v 1.16 1996/02/13 23:43:20 christos Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -260,7 +260,7 @@ void ip_savecontrol(struct inpcb *, struct mbuf **, struct ip *,
|
|||
struct mbuf *);
|
||||
int ip_input_if(struct mbuf **, int *, int, int, struct ifnet *);
|
||||
int ip_deliver(struct mbuf **, int *, int, int, int);
|
||||
void ip_forward(struct mbuf *, struct ifnet *, struct rtentry *, int);
|
||||
void ip_forward(struct mbuf *, struct ifnet *, struct route *, int);
|
||||
int rip_ctloutput(int, struct socket *, int, int, struct mbuf *);
|
||||
void rip_init(void);
|
||||
int rip_input(struct mbuf **, int *, int, int);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: in6.c,v 1.262 2023/06/28 11:49:49 kn Exp $ */
|
||||
/* $OpenBSD: in6.c,v 1.263 2024/04/16 14:37:49 florian Exp $ */
|
||||
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -565,7 +565,7 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
|
|||
* The destination address for a p2p link must have a family
|
||||
* of AF_UNSPEC or AF_INET6.
|
||||
*/
|
||||
if ((ifp->if_flags & IFF_POINTOPOINT) != 0 &&
|
||||
if ((ifp->if_flags & IFF_POINTOPOINT) &&
|
||||
ifra->ifra_dstaddr.sin6_family != AF_INET6 &&
|
||||
ifra->ifra_dstaddr.sin6_family != AF_UNSPEC)
|
||||
return (EAFNOSUPPORT);
|
||||
|
@ -603,19 +603,18 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
|
|||
* zone identifier.
|
||||
*/
|
||||
dst6 = ifra->ifra_dstaddr;
|
||||
if ((ifp->if_flags & (IFF_POINTOPOINT|IFF_LOOPBACK)) != 0 &&
|
||||
if ((ifp->if_flags & IFF_POINTOPOINT) &&
|
||||
(dst6.sin6_family == AF_INET6)) {
|
||||
error = in6_check_embed_scope(&dst6, ifp->if_index);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
/*
|
||||
* The destination address can be specified only for a p2p or a
|
||||
* loopback interface. If specified, the corresponding prefix length
|
||||
* must be 128.
|
||||
* The destination address can be specified only for a p2p interface.
|
||||
* If specified, the corresponding prefix length must be 128.
|
||||
*/
|
||||
if (ifra->ifra_dstaddr.sin6_family == AF_INET6) {
|
||||
if ((ifp->if_flags & (IFF_POINTOPOINT|IFF_LOOPBACK)) == 0)
|
||||
if (!(ifp->if_flags & IFF_POINTOPOINT))
|
||||
return (EINVAL);
|
||||
if (plen != 128)
|
||||
return (EINVAL);
|
||||
|
@ -652,7 +651,7 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
|
|||
ia6->ia_addr.sin6_family = AF_INET6;
|
||||
ia6->ia_addr.sin6_len = sizeof(ia6->ia_addr);
|
||||
ia6->ia6_updatetime = getuptime();
|
||||
if ((ifp->if_flags & (IFF_POINTOPOINT | IFF_LOOPBACK)) != 0) {
|
||||
if (ifp->if_flags & IFF_POINTOPOINT) {
|
||||
/*
|
||||
* XXX: some functions expect that ifa_dstaddr is not
|
||||
* NULL for p2p interfaces.
|
||||
|
@ -687,7 +686,7 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
|
|||
/*
|
||||
* If a new destination address is specified, scrub the old one and
|
||||
* install the new destination. Note that the interface must be
|
||||
* p2p or loopback (see the check above.)
|
||||
* p2p (see the check above.)
|
||||
*/
|
||||
if ((ifp->if_flags & IFF_POINTOPOINT) && dst6.sin6_family == AF_INET6 &&
|
||||
!IN6_ARE_ADDR_EQUAL(&dst6.sin6_addr, &ia6->ia_dstaddr.sin6_addr)) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: in6_proto.c,v 1.113 2024/01/11 14:15:12 bluhm Exp $ */
|
||||
/* $OpenBSD: in6_proto.c,v 1.114 2024/04/16 12:40:40 bluhm Exp $ */
|
||||
/* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -158,7 +158,7 @@ const struct protosw inet6sw[] = {
|
|||
.pr_type = SOCK_RAW,
|
||||
.pr_domain = &inet6domain,
|
||||
.pr_protocol = IPPROTO_RAW,
|
||||
.pr_flags = PR_ATOMIC|PR_ADDR,
|
||||
.pr_flags = PR_ATOMIC|PR_ADDR|PR_MPINPUT,
|
||||
.pr_input = rip6_input,
|
||||
.pr_ctlinput = rip6_ctlinput,
|
||||
.pr_ctloutput = rip6_ctloutput,
|
||||
|
@ -322,7 +322,7 @@ const struct protosw inet6sw[] = {
|
|||
/* raw wildcard */
|
||||
.pr_type = SOCK_RAW,
|
||||
.pr_domain = &inet6domain,
|
||||
.pr_flags = PR_ATOMIC|PR_ADDR,
|
||||
.pr_flags = PR_ATOMIC|PR_ADDR|PR_MPINPUT,
|
||||
.pr_input = rip6_input,
|
||||
.pr_ctloutput = rip6_ctloutput,
|
||||
.pr_usrreqs = &rip6_usrreqs,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ip6_forward.c,v 1.116 2024/02/28 10:57:20 bluhm Exp $ */
|
||||
/* $OpenBSD: ip6_forward.c,v 1.117 2024/04/16 12:56:39 bluhm Exp $ */
|
||||
/* $KAME: ip6_forward.c,v 1.75 2001/06/29 12:42:13 jinmei Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -82,11 +82,12 @@
|
|||
*/
|
||||
|
||||
void
|
||||
ip6_forward(struct mbuf *m, struct rtentry *rt, int srcrt)
|
||||
ip6_forward(struct mbuf *m, struct route *ro, int srcrt)
|
||||
{
|
||||
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
|
||||
struct route iproute;
|
||||
struct rtentry *rt;
|
||||
struct sockaddr *dst;
|
||||
struct route ro;
|
||||
struct ifnet *ifp = NULL;
|
||||
int error = 0, type = 0, code = 0, destmtu = 0;
|
||||
struct mbuf *mcopy;
|
||||
|
@ -165,25 +166,22 @@ reroute:
|
|||
}
|
||||
#endif /* IPSEC */
|
||||
|
||||
ro.ro_rt = NULL;
|
||||
route6_cache(&ro, &ip6->ip6_dst, &ip6->ip6_src,
|
||||
m->m_pkthdr.ph_rtableid);
|
||||
dst = &ro.ro_dstsa;
|
||||
if (!rtisvalid(rt)) {
|
||||
rtfree(rt);
|
||||
rt = rtalloc_mpath(dst, &ip6->ip6_src.s6_addr32[0],
|
||||
m->m_pkthdr.ph_rtableid);
|
||||
if (rt == NULL) {
|
||||
ip6stat_inc(ip6s_noroute);
|
||||
if (mcopy != NULL) {
|
||||
icmp6_error(mcopy, ICMP6_DST_UNREACH,
|
||||
ICMP6_DST_UNREACH_NOROUTE, 0);
|
||||
}
|
||||
m_freem(m);
|
||||
goto done;
|
||||
}
|
||||
if (ro == NULL) {
|
||||
ro = &iproute;
|
||||
ro->ro_rt = NULL;
|
||||
}
|
||||
ro.ro_rt = rt;
|
||||
rt = route6_mpath(ro, &ip6->ip6_dst, &ip6->ip6_src,
|
||||
m->m_pkthdr.ph_rtableid);
|
||||
if (rt == NULL) {
|
||||
ip6stat_inc(ip6s_noroute);
|
||||
if (mcopy != NULL) {
|
||||
icmp6_error(mcopy, ICMP6_DST_UNREACH,
|
||||
ICMP6_DST_UNREACH_NOROUTE, 0);
|
||||
}
|
||||
m_freem(m);
|
||||
goto done;
|
||||
}
|
||||
dst = &ro->ro_dstsa;
|
||||
|
||||
/*
|
||||
* Scope check: if a packet can't be delivered to its destination
|
||||
|
@ -225,8 +223,8 @@ reroute:
|
|||
*/
|
||||
if (tdb != NULL) {
|
||||
/* Callee frees mbuf */
|
||||
error = ip6_output_ipsec_send(tdb, m, &ro, 0, 1);
|
||||
rt = ro.ro_rt;
|
||||
error = ip6_output_ipsec_send(tdb, m, ro, 0, 1);
|
||||
rt = ro->ro_rt;
|
||||
if (error)
|
||||
goto senderr;
|
||||
goto freecopy;
|
||||
|
@ -254,7 +252,7 @@ reroute:
|
|||
ip6_sendredirects &&
|
||||
(rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0) {
|
||||
if ((ifp->if_flags & IFF_POINTOPOINT) &&
|
||||
nd6_is_addr_neighbor(&ro.ro_dstsin6, ifp)) {
|
||||
nd6_is_addr_neighbor(&ro->ro_dstsin6, ifp)) {
|
||||
/*
|
||||
* If the incoming interface is equal to the outgoing
|
||||
* one, the link attached to the interface is
|
||||
|
@ -308,8 +306,9 @@ reroute:
|
|||
/* tag as generated to skip over pf_test on rerun */
|
||||
m->m_pkthdr.pf.flags |= PF_TAG_GENERATED;
|
||||
srcrt = 1;
|
||||
rtfree(rt);
|
||||
rt = NULL;
|
||||
if (ro == &iproute)
|
||||
rtfree(ro->ro_rt);
|
||||
ro = NULL;
|
||||
if_put(ifp);
|
||||
ifp = NULL;
|
||||
goto reroute;
|
||||
|
@ -388,7 +387,8 @@ senderr:
|
|||
freecopy:
|
||||
m_freem(mcopy);
|
||||
done:
|
||||
rtfree(rt);
|
||||
if (ro == &iproute)
|
||||
rtfree(ro->ro_rt);
|
||||
if_put(ifp);
|
||||
#ifdef IPSEC
|
||||
tdb_unref(tdb);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ip6_input.c,v 1.260 2024/04/14 20:46:27 bluhm Exp $ */
|
||||
/* $OpenBSD: ip6_input.c,v 1.261 2024/04/16 12:56:39 bluhm Exp $ */
|
||||
/* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -356,10 +356,10 @@ bad:
|
|||
int
|
||||
ip6_input_if(struct mbuf **mp, int *offp, int nxt, int af, struct ifnet *ifp)
|
||||
{
|
||||
struct route ro;
|
||||
struct mbuf *m;
|
||||
struct ip6_hdr *ip6;
|
||||
struct sockaddr_in6 sin6;
|
||||
struct rtentry *rt = NULL;
|
||||
struct rtentry *rt;
|
||||
int ours = 0;
|
||||
u_int16_t src_scope, dst_scope;
|
||||
#if NPF > 0
|
||||
|
@ -369,8 +369,8 @@ ip6_input_if(struct mbuf **mp, int *offp, int nxt, int af, struct ifnet *ifp)
|
|||
|
||||
KASSERT(*offp == 0);
|
||||
|
||||
ro.ro_rt = NULL;
|
||||
ip6stat_inc(ip6s_total);
|
||||
|
||||
m = *mp = ipv6_check(ifp, *mp);
|
||||
if (m == NULL)
|
||||
goto bad;
|
||||
|
@ -516,18 +516,14 @@ ip6_input_if(struct mbuf **mp, int *offp, int nxt, int af, struct ifnet *ifp)
|
|||
/*
|
||||
* Unicast check
|
||||
*/
|
||||
memset(&sin6, 0, sizeof(struct sockaddr_in6));
|
||||
sin6.sin6_len = sizeof(struct sockaddr_in6);
|
||||
sin6.sin6_family = AF_INET6;
|
||||
sin6.sin6_addr = ip6->ip6_dst;
|
||||
rt = rtalloc_mpath(sin6tosa(&sin6), &ip6->ip6_src.s6_addr32[0],
|
||||
rt = route6_mpath(&ro, &ip6->ip6_dst, &ip6->ip6_src,
|
||||
m->m_pkthdr.ph_rtableid);
|
||||
|
||||
/*
|
||||
* Accept the packet if the route to the destination is marked
|
||||
* as local.
|
||||
*/
|
||||
if (rtisvalid(rt) && ISSET(rt->rt_flags, RTF_LOCAL)) {
|
||||
if (rt != NULL && ISSET(rt->rt_flags, RTF_LOCAL)) {
|
||||
struct in6_ifaddr *ia6 = ifatoia6(rt->rt_ifa);
|
||||
|
||||
if (ip6_forwarding == 0 && rt->rt_ifidx != ifp->if_index &&
|
||||
|
@ -617,14 +613,14 @@ ip6_input_if(struct mbuf **mp, int *offp, int nxt, int af, struct ifnet *ifp)
|
|||
}
|
||||
#endif /* IPSEC */
|
||||
|
||||
ip6_forward(m, rt, pfrdr);
|
||||
ip6_forward(m, &ro, pfrdr);
|
||||
*mp = NULL;
|
||||
return IPPROTO_DONE;
|
||||
bad:
|
||||
nxt = IPPROTO_DONE;
|
||||
m_freemp(mp);
|
||||
out:
|
||||
rtfree(rt);
|
||||
rtfree(ro.ro_rt);
|
||||
return nxt;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ip6_output.c,v 1.289 2024/04/09 11:05:05 bluhm Exp $ */
|
||||
/* $OpenBSD: ip6_output.c,v 1.290 2024/04/16 12:56:39 bluhm Exp $ */
|
||||
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -391,7 +391,7 @@ reroute:
|
|||
/* initialize cached route */
|
||||
if (ro == NULL) {
|
||||
ro = &iproute;
|
||||
bzero((caddr_t)ro, sizeof(*ro));
|
||||
ro->ro_rt = NULL;
|
||||
}
|
||||
ro_pmtu = ro;
|
||||
if (opt && opt->ip6po_rthdr)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ip6_var.h,v 1.114 2024/02/14 13:18:21 claudio Exp $ */
|
||||
/* $OpenBSD: ip6_var.h,v 1.115 2024/04/16 12:56:39 bluhm Exp $ */
|
||||
/* $KAME: ip6_var.h,v 1.33 2000/06/11 14:59:20 jinmei Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -320,7 +320,7 @@ int ip6_process_hopopts(struct mbuf **, u_int8_t *, int, u_int32_t *,
|
|||
void ip6_savecontrol(struct inpcb *, struct mbuf *, struct mbuf **);
|
||||
int ip6_sysctl(int *, u_int, void *, size_t *, void *, size_t);
|
||||
|
||||
void ip6_forward(struct mbuf *, struct rtentry *, int);
|
||||
void ip6_forward(struct mbuf *, struct route *, int);
|
||||
|
||||
void ip6_mloopback(struct ifnet *, struct mbuf *, struct sockaddr_in6 *);
|
||||
int ip6_output(struct mbuf *, struct ip6_pktopts *, struct route *, int,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: raw_ip6.c,v 1.182 2024/02/13 12:22:09 bluhm Exp $ */
|
||||
/* $OpenBSD: raw_ip6.c,v 1.183 2024/04/16 12:40:40 bluhm Exp $ */
|
||||
/* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -155,9 +155,9 @@ rip6_input(struct mbuf **mp, int *offp, int proto, int af)
|
|||
} else
|
||||
rip6stat_inc(rip6s_ipackets);
|
||||
|
||||
bzero(&rip6src, sizeof(rip6src));
|
||||
rip6src.sin6_len = sizeof(struct sockaddr_in6);
|
||||
memset(&rip6src, 0, sizeof(rip6src));
|
||||
rip6src.sin6_family = AF_INET6;
|
||||
rip6src.sin6_len = sizeof(rip6src);
|
||||
/* KAME hack: recover scopeid */
|
||||
in6_recoverscope(&rip6src, &ip6->ip6_src);
|
||||
|
||||
|
@ -186,7 +186,13 @@ rip6_input(struct mbuf **mp, int *offp, int proto, int af)
|
|||
TAILQ_FOREACH(inp, &rawin6pcbtable.inpt_queue, inp_queue) {
|
||||
KASSERT(ISSET(inp->inp_flags, INP_IPV6));
|
||||
|
||||
if (inp->inp_socket->so_rcv.sb_state & SS_CANTRCVMORE)
|
||||
/*
|
||||
* Packet must not be inserted after disconnected wakeup
|
||||
* call. To avoid race, check again when holding receive
|
||||
* buffer mutex.
|
||||
*/
|
||||
if (ISSET(READ_ONCE(inp->inp_socket->so_rcv.sb_state),
|
||||
SS_CANTRCVMORE))
|
||||
continue;
|
||||
if (rtable_l2(inp->inp_rtableid) !=
|
||||
rtable_l2(m->m_pkthdr.ph_rtableid))
|
||||
|
@ -264,7 +270,7 @@ rip6_input(struct mbuf **mp, int *offp, int proto, int af)
|
|||
n = m_copym(m, 0, M_COPYALL, M_NOWAIT);
|
||||
if (n != NULL) {
|
||||
struct socket *so = inp->inp_socket;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
if (inp->inp_flags & IN6P_CONTROLOPTS)
|
||||
ip6_savecontrol(inp, n, &opts);
|
||||
|
@ -272,12 +278,14 @@ rip6_input(struct mbuf **mp, int *offp, int proto, int af)
|
|||
m_adj(n, *offp);
|
||||
|
||||
mtx_enter(&so->so_rcv.sb_mtx);
|
||||
ret = sbappendaddr(so, &so->so_rcv,
|
||||
sin6tosa(&rip6src), n, opts);
|
||||
if (!ISSET(inp->inp_socket->so_rcv.sb_state,
|
||||
SS_CANTRCVMORE)) {
|
||||
ret = sbappendaddr(so, &so->so_rcv,
|
||||
sin6tosa(&rip6src), n, opts);
|
||||
}
|
||||
mtx_leave(&so->so_rcv.sb_mtx);
|
||||
|
||||
if (ret == 0) {
|
||||
/* should notify about lost packet */
|
||||
m_freem(n);
|
||||
m_freem(opts);
|
||||
rip6stat_inc(rip6s_fullsock);
|
||||
|
@ -727,7 +735,7 @@ rip6_disconnect(struct socket *so)
|
|||
if ((so->so_state & SS_ISCONNECTED) == 0)
|
||||
return (ENOTCONN);
|
||||
|
||||
so->so_state &= ~SS_ISCONNECTED; /* XXX */
|
||||
soisdisconnected(so);
|
||||
mtx_enter(&rawin6pcbtable.inpt_mtx);
|
||||
inp->inp_faddr6 = in6addr_any;
|
||||
mtx_leave(&rawin6pcbtable.inpt_mtx);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: mfs_vnops.c,v 1.60 2022/06/26 05:20:43 visa Exp $ */
|
||||
/* $OpenBSD: mfs_vnops.c,v 1.61 2024/04/16 10:04:41 claudio Exp $ */
|
||||
/* $NetBSD: mfs_vnops.c,v 1.8 1996/03/17 02:16:32 christos Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -237,6 +237,9 @@ mfs_reclaim(void *v)
|
|||
{
|
||||
struct vop_reclaim_args *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct mfsnode *mfsp = VTOMFS(vp);
|
||||
|
||||
bufq_destroy(&mfsp->mfs_bufq);
|
||||
|
||||
free(vp->v_data, M_MFSNODE, sizeof(struct mfsnode));
|
||||
vp->v_data = NULL;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: uvm_amap.c,v 1.92 2023/04/11 00:45:09 jsg Exp $ */
|
||||
/* $OpenBSD: uvm_amap.c,v 1.93 2024/04/16 08:53:02 mpi Exp $ */
|
||||
/* $NetBSD: uvm_amap.c,v 1.27 2000/11/25 06:27:59 chs Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -662,9 +662,10 @@ amap_copy(struct vm_map *map, struct vm_map_entry *entry, int waitf,
|
|||
|
||||
chunk = amap_chunk_get(amap, lcv, 1, PR_NOWAIT);
|
||||
if (chunk == NULL) {
|
||||
/* amap_wipeout() releases the lock. */
|
||||
amap->am_ref = 0;
|
||||
amap_wipeout(amap);
|
||||
amap_unlock(srcamap);
|
||||
/* Destroy the new amap. */
|
||||
amap->am_ref--;
|
||||
amap_free(amap);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: uvm_swap.c,v 1.169 2024/02/03 18:51:59 beck Exp $ */
|
||||
/* $OpenBSD: uvm_swap.c,v 1.170 2024/04/16 10:06:37 claudio Exp $ */
|
||||
/* $NetBSD: uvm_swap.c,v 1.40 2000/11/17 11:39:39 mrg Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -1088,6 +1088,7 @@ swap_off(struct proc *p, struct swapdev *sdp)
|
|||
*/
|
||||
if (sdp->swd_vp->v_type == VREG) {
|
||||
crfree(sdp->swd_cred);
|
||||
bufq_destroy(&sdp->swd_bufq);
|
||||
}
|
||||
vrele(sdp->swd_vp);
|
||||
if (sdp->swd_vp != rootvp) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue