-/* $OpenBSD: in_pcb.h,v 1.143 2023/12/07 16:08:30 bluhm Exp $ */
+/* $OpenBSD: in_pcb.h,v 1.144 2023/12/15 00:24:56 bluhm Exp $ */
/* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */
/*
TAILQ_ENTRY(inpcb) inp_queue; /* [t] inet PCB queue */
SIMPLEQ_ENTRY(inpcb) inp_notify; /* [y] notify or udp append */
struct inpcbtable *inp_table; /* [I] inet queue/hash table */
- union inpaddru inp_faddru; /* Foreign address. */
- union inpaddru inp_laddru; /* Local address. */
+ union inpaddru inp_faddru; /* [t] Foreign address. */
+ union inpaddru inp_laddru; /* [t] Local address. */
#define inp_faddr inp_faddru.iau_a4u.inaddr
#define inp_faddr6 inp_faddru.iau_addr6
#define inp_laddr inp_laddru.iau_a4u.inaddr
#define inp_laddr6 inp_laddru.iau_addr6
- u_int16_t inp_fport; /* foreign port */
- u_int16_t inp_lport; /* local port */
+ u_int16_t inp_fport; /* [t] foreign port */
+ u_int16_t inp_lport; /* [t] local port */
struct socket *inp_socket; /* [I] back pointer to socket */
caddr_t inp_ppcb; /* pointer to per-protocol pcb */
union { /* Route (notice increased size). */
struct mbuf *(*inp_upcall)(void *, struct mbuf *,
struct ip *, struct ip6_hdr *, void *, int);
void *inp_upcall_arg;
- u_int inp_rtableid;
+ u_int inp_rtableid; /* [t] */
int inp_pipex; /* pipex indication */
uint16_t inp_flowid;
};
-/* $OpenBSD: ip_gre.c,v 1.86 2023/04/08 13:50:22 mvs Exp $ */
+/* $OpenBSD: ip_gre.c,v 1.87 2023/12/15 00:24:56 bluhm Exp $ */
/* $NetBSD: ip_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
if (inp->inp_pipex) {
struct sockaddr_in *sin4;
- struct in_addr *ina_dst;
+ const struct in_addr *ina_dst;
ina_dst = NULL;
if ((so->so_state & SS_ISCONNECTED) != 0)
-/* $OpenBSD: raw_ip.c,v 1.152 2023/11/26 22:08:10 bluhm Exp $ */
+/* $OpenBSD: raw_ip.c,v 1.153 2023/12/15 00:24:56 bluhm Exp $ */
/* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */
/*
ifa_ifwithaddr(sintosa(addr), inp->inp_rtableid)))
return (EADDRNOTAVAIL);
+ mtx_enter(&rawcbtable.inpt_mtx);
inp->inp_laddr = addr->sin_addr;
+ mtx_leave(&rawcbtable.inpt_mtx);
return (0);
}
if ((error = in_nam2sin(nam, &addr)))
return (error);
+ mtx_enter(&rawcbtable.inpt_mtx);
inp->inp_faddr = addr->sin_addr;
+ mtx_leave(&rawcbtable.inpt_mtx);
soisconnected(so);
return (0);
return (ENOTCONN);
soisdisconnected(so);
+ mtx_enter(&rawcbtable.inpt_mtx);
inp->inp_faddr.s_addr = INADDR_ANY;
+ mtx_leave(&rawcbtable.inpt_mtx);
return (0);
}
-/* $OpenBSD: in6_src.c,v 1.89 2023/12/03 20:36:24 bluhm Exp $ */
+/* $OpenBSD: in6_src.c,v 1.90 2023/12/15 00:24:56 bluhm Exp $ */
/* $KAME: in6_src.c,v 1.36 2001/02/06 04:08:17 itojun Exp $ */
/*
{
struct ip6_moptions *mopts = inp->inp_moptions6;
struct route_in6 *ro = &inp->inp_route6;
- struct in6_addr *laddr = &inp->inp_laddr6;
+ const struct in6_addr *laddr = &inp->inp_laddr6;
u_int rtableid = inp->inp_rtableid;
struct ifnet *ifp = NULL;
struct sockaddr *ip6_source = NULL;
-/* $OpenBSD: raw_ip6.c,v 1.177 2023/12/03 20:36:24 bluhm Exp $ */
+/* $OpenBSD: raw_ip6.c,v 1.178 2023/12/15 00:24:56 bluhm Exp $ */
/* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */
/*
if ((error = in6_pcbaddrisavail(inp, addr, 0, p)))
return (error);
+ mtx_enter(&rawin6pcbtable.inpt_mtx);
inp->inp_laddr6 = addr->sin6_addr;
+ mtx_leave(&rawin6pcbtable.inpt_mtx);
+
return (0);
}
if (error)
return (error);
+ mtx_enter(&rawin6pcbtable.inpt_mtx);
inp->inp_laddr6 = *in6a;
inp->inp_faddr6 = addr->sin6_addr;
+ mtx_leave(&rawin6pcbtable.inpt_mtx);
soisconnected(so);
+
return (0);
}
if ((so->so_state & SS_ISCONNECTED) == 0)
return (ENOTCONN);
- inp->inp_faddr6 = in6addr_any;
so->so_state &= ~SS_ISCONNECTED; /* XXX */
+ mtx_enter(&rawin6pcbtable.inpt_mtx);
+ inp->inp_faddr6 = in6addr_any;
+ mtx_leave(&rawin6pcbtable.inpt_mtx);
+
return (0);
}