-/* $OpenBSD: in_pcb.c,v 1.252 2020/11/07 09:51:40 denis Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.253 2021/01/25 03:40:46 dlg Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
#include <netinet/ip_esp.h>
#endif /* IPSEC */
+#include "stoeplitz.h"
+#if NSTOEPLITZ > 0
+#include <net/toeplitz.h>
+#endif
+
const struct in_addr zeroin_addr;
union {
inp->inp_faddr = sin->sin_addr;
inp->inp_fport = sin->sin_port;
in_pcbrehash(inp);
+#if NSTOEPLITZ > 0
+ inp->inp_flowid = stoeplitz_ip4port(inp->inp_laddr.s_addr,
+ inp->inp_faddr.s_addr, inp->inp_lport, inp->inp_fport);
+#endif
#ifdef IPSEC
{
/* Cause an IPsec SA to be established. */
}
inp->inp_fport = 0;
+ inp->inp_flowid = 0;
in_pcbrehash(inp);
if (inp->inp_socket->so_state & SS_NOFDREF)
in_pcbdetach(inp);
-/* $OpenBSD: in_pcb.h,v 1.120 2020/06/21 05:14:04 dlg Exp $ */
+/* $OpenBSD: in_pcb.h,v 1.121 2021/01/25 03:40:46 dlg Exp $ */
/* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */
/*
void *inp_upcall_arg;
u_int inp_rtableid;
int inp_pipex; /* pipex indication */
+ uint16_t inp_flowid;
};
LIST_HEAD(inpcbhead, inpcb);
-/* $OpenBSD: tcp_output.c,v 1.128 2018/11/10 18:40:34 bluhm Exp $ */
+/* $OpenBSD: tcp_output.c,v 1.129 2021/01/25 03:40:46 dlg Exp $ */
/* $NetBSD: tcp_output.c,v 1.16 1997/06/03 16:17:09 kml Exp $ */
/*
*/
#include "pf.h"
+#include "stoeplitz.h"
#include <sys/param.h>
#include <sys/systm.h>
ip->ip_tos |= IPTOS_ECN_ECT0;
#endif
}
+#if NSTOEPLITZ > 0
+ m->m_pkthdr.ph_flowid = tp->t_inpcb->inp_flowid;
+ SET(m->m_pkthdr.csum_flags, M_FLOWID);
+#endif
error = ip_output(m, tp->t_inpcb->inp_options,
&tp->t_inpcb->inp_route,
(ip_mtudisc ? IP_MTUDISC : 0), NULL, tp->t_inpcb, 0);
-/* $OpenBSD: in6_pcb.c,v 1.110 2019/11/29 16:41:01 nayden Exp $ */
+/* $OpenBSD: in6_pcb.c,v 1.111 2021/01/25 03:40:47 dlg Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
*/
#include "pf.h"
+#include "stoeplitz.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <netinet6/in6_var.h>
+#if NSTOEPLITZ > 0
+#include <net/toeplitz.h>
+#endif
+
const struct in6_addr zeroin6_addr;
struct inpcbhead *
if (ip6_auto_flowlabel)
inp->inp_flowinfo |=
(htonl(ip6_randomflowlabel()) & IPV6_FLOWLABEL_MASK);
+#if NSTOEPLITZ > 0
+ inp->inp_flowid = stoeplitz_ip6port(&inp->inp_laddr6,
+ &inp->inp_faddr6, inp->inp_lport, inp->inp_fport);
+#endif
in_pcbrehash(inp);
return (0);
}