-/* $OpenBSD: in_pcb.c,v 1.285 2024/01/18 11:03:16 claudio Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.286 2024/01/19 02:24:07 bluhm Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
#ifdef INET6
if (ISSET(inp->inp_flags, INP_IPV6))
return (in6_pcbconnect(inp, nam));
-#endif /* INET6 */
+#endif
if ((error = in_nam2sin(nam, &sin)))
return (error);
{
struct sockaddr_in *sin;
+#ifdef INET6
+ if (ISSET(inp->inp_flags, INP_IPV6)) {
+ in6_setsockaddr(inp, nam);
+ return;
+ }
+#endif
+
nam->m_len = sizeof(*sin);
sin = mtod(nam, struct sockaddr_in *);
memset(sin, 0, sizeof(*sin));
in6_setpeeraddr(inp, nam);
return;
}
-#endif /* INET6 */
+#endif
nam->m_len = sizeof(*sin);
sin = mtod(nam, struct sockaddr_in *);
-/* $OpenBSD: tcp_usrreq.c,v 1.228 2024/01/11 13:49:49 bluhm Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.229 2024/01/19 02:24:07 bluhm Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
{
struct inpcb *inp;
struct tcpcb *otp = NULL, *tp;
- int error = 0;
+ int error;
short ostate;
soassertlocked(so);
if (otp)
tcp_trace(TA_USER, ostate, tp, otp, NULL, PRU_DETACH, 0);
- return (error);
+ return (0);
}
/*
struct inpcb *inp;
struct tcpcb *tp;
int error;
- short ostate;
soassertlocked(so);
if ((error = tcp_sogetpcb(so, &inp, &tp)))
return (error);
- if (so->so_options & SO_DEBUG)
- ostate = tp->t_state;
-
-#ifdef INET6
- if (inp->inp_flags & INP_IPV6)
- in6_setpeeraddr(inp, nam);
- else
-#endif
- in_setpeeraddr(inp, nam);
+ in_setpeeraddr(inp, nam);
if (so->so_options & SO_DEBUG)
- tcp_trace(TA_USER, ostate, tp, tp, NULL, PRU_ACCEPT, 0);
- return (error);
+ tcp_trace(TA_USER, tp->t_state, tp, tp, NULL, PRU_ACCEPT, 0);
+ return (0);
}
/*
if ((error = tcp_sogetpcb(so, &inp, &tp)))
return (error);
-#ifdef INET6
- if (inp->inp_flags & INP_IPV6)
- in6_setsockaddr(inp, nam);
- else
-#endif
- in_setsockaddr(inp, nam);
+ in_setsockaddr(inp, nam);
if (so->so_options & SO_DEBUG)
tcp_trace(TA_USER, tp->t_state, tp, tp, NULL,
if ((error = tcp_sogetpcb(so, &inp, &tp)))
return (error);
-#ifdef INET6
- if (inp->inp_flags & INP_IPV6)
- in6_setpeeraddr(inp, nam);
- else
-#endif
- in_setpeeraddr(inp, nam);
+ in_setpeeraddr(inp, nam);
if (so->so_options & SO_DEBUG)
- tcp_trace(TA_USER, tp->t_state, tp, tp, NULL,
- PRU_PEERADDR, 0);
+ tcp_trace(TA_USER, tp->t_state, tp, tp, NULL, PRU_PEERADDR, 0);
return (0);
}
-/* $OpenBSD: udp_usrreq.c,v 1.313 2024/01/10 16:44:30 bluhm Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.314 2024/01/19 02:24:07 bluhm Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
struct in_addr laddr;
int error = 0;
-#ifdef DIAGNOSTIC
- if ((inp->inp_flags & INP_IPV6) != 0)
- panic("IPv6 inpcb to %s", __func__);
+#ifdef INET6
+ if (ISSET(inp->inp_flags, INP_IPV6))
+ return (udp6_output(inp, m, addr, control));
#endif
/*
struct mbuf *control)
{
struct inpcb *inp = sotoinpcb(so);
- int error;
soassertlocked(so);
}
#endif
-#ifdef INET6
- if (inp->inp_flags & INP_IPV6)
- error = udp6_output(inp, m, addr, control);
- else
-#endif
- error = udp_output(inp, m, addr, control);
-
- return (error);
+ return (udp_output(inp, m, addr, control));
}
/*