aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/in_pcb.c28
-rw-r--r--sys/netinet/in_pcb.h3
-rw-r--r--sys/netinet/raw_ip.c4
-rw-r--r--sys/netinet/tcp.h1
-rw-r--r--sys/netinet/tcp_syncache.c14
-rw-r--r--sys/netinet/tcp_usrreq.c21
6 files changed, 46 insertions, 25 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 712ff28768dc..79c77c105d9e 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -3076,10 +3076,6 @@ db_print_inpflags(int inp_flags)
db_printf("%sINP_RECVDSTADDR", comma ? ", " : "");
comma = 1;
}
- if (inp_flags & INP_ORIGDSTADDR) {
- db_printf("%sINP_ORIGDSTADDR", comma ? ", " : "");
- comma = 1;
- }
if (inp_flags & INP_HDRINCL) {
db_printf("%sINP_HDRINCL", comma ? ", " : "");
comma = 1;
@@ -3112,6 +3108,14 @@ db_print_inpflags(int inp_flags)
db_printf("%sINP_DONTFRAG", comma ? ", " : "");
comma = 1;
}
+ if (inp_flags & INP_BINDANY) {
+ db_printf("%sINP_BINDANY", comma ? ", " : "");
+ comma = 1;
+ }
+ if (inp_flags & INP_INHASHLIST) {
+ db_printf("%sINP_INHASHLIST", comma ? ", " : "");
+ comma = 1;
+ }
if (inp_flags & INP_RECVTOS) {
db_printf("%sINP_RECVTOS", comma ? ", " : "");
comma = 1;
@@ -3154,15 +3158,23 @@ db_print_inpflags(int inp_flags)
}
if (inp_flags & INP_ONESBCAST) {
db_printf("%sINP_ONESBCAST", comma ? ", " : "");
- comma = 1;
+ comma = 1;
}
if (inp_flags & INP_DROPPED) {
db_printf("%sINP_DROPPED", comma ? ", " : "");
- comma = 1;
+ comma = 1;
}
if (inp_flags & INP_SOCKREF) {
db_printf("%sINP_SOCKREF", comma ? ", " : "");
- comma = 1;
+ comma = 1;
+ }
+ if (inp_flags & INP_RESERVED_0) {
+ db_printf("%sINP_RESERVED_0", comma ? ", " : "");
+ comma = 1;
+ }
+ if (inp_flags & INP_BOUNDFIB) {
+ db_printf("%sINP_BOUNDFIB", comma ? ", " : "");
+ comma = 1;
}
if (inp_flags & IN6P_RFC2292) {
db_printf("%sIN6P_RFC2292", comma ? ", " : "");
@@ -3194,7 +3206,7 @@ db_print_inpvflag(u_char inp_vflag)
}
}
-static void
+void
db_print_inpcb(struct inpcb *inp, const char *name, int indent)
{
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
index 9e0618e87601..7d41e3d690e0 100644
--- a/sys/netinet/in_pcb.h
+++ b/sys/netinet/in_pcb.h
@@ -730,6 +730,9 @@ int in_pcbquery_txrlevel(struct inpcb *, uint32_t *);
void in_pcboutput_txrtlmt(struct inpcb *, struct ifnet *, struct mbuf *);
void in_pcboutput_eagain(struct inpcb *);
#endif
+#ifdef DDB
+void db_print_inpcb(struct inpcb *, const char *, int);
+#endif
#endif /* _KERNEL */
#endif /* !_NETINET_IN_PCB_H_ */
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 66070faf97e9..bfe608be6b36 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -680,7 +680,6 @@ rip_ctloutput(struct socket *so, struct sockopt *sopt)
break;
case IP_DUMMYNET3: /* generic dummynet v.3 functions */
- case IP_DUMMYNET_GET:
if (ip_dn_ctl_ptr != NULL)
error = ip_dn_ctl_ptr(sopt);
else
@@ -747,9 +746,6 @@ rip_ctloutput(struct socket *so, struct sockopt *sopt)
break;
case IP_DUMMYNET3: /* generic dummynet v.3 functions */
- case IP_DUMMYNET_CONFIGURE:
- case IP_DUMMYNET_DEL:
- case IP_DUMMYNET_FLUSH:
if (ip_dn_ctl_ptr != NULL)
error = ip_dn_ctl_ptr(sopt);
else
diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h
index 41a49b318cd5..cab7d1c5e726 100644
--- a/sys/netinet/tcp.h
+++ b/sys/netinet/tcp.h
@@ -541,7 +541,6 @@ struct tcp_log_user {
#define TCP_HYBRID_PACING_H_MS 0x0008 /* A client hint for maxseg is present */
#define TCP_HYBRID_PACING_ENABLE 0x0010 /* We are enabling hybrid pacing else disable */
#define TCP_HYBRID_PACING_S_MSS 0x0020 /* Clent wants us to set the mss overriding gp est in CU */
-#define TCP_HAS_PLAYOUT_MS 0x0040 /* The client included the chunk playout milliseconds: deprecate */
/* the below are internal only flags */
#define TCP_HYBRID_PACING_USER_MASK 0x0FFF /* Non-internal flags mask */
#define TCP_HYBRID_PACING_SETMSS 0x1000 /* Internal flag that tells us we set the mss on this entry */
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index 3cb538f7054d..3a7755e9f09e 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -1380,6 +1380,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th,
struct tcpcb *tp;
struct socket *rv = NULL;
struct syncache *sc = NULL;
+ struct ucred *cred;
struct syncache_head *sch;
struct mbuf *ipopts = NULL;
u_int ltflags;
@@ -1408,6 +1409,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th,
*/
KASSERT(SOLISTENING(so), ("%s: %p not listening", __func__, so));
tp = sototcpcb(so);
+ cred = V_tcp_syncache.see_other ? NULL : crhold(so->so_cred);
#ifdef INET6
if (inc->inc_flags & INC_ISIPV6) {
@@ -1636,16 +1638,16 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th,
/*
* sc_cred is only used in syncache_pcblist() to list TCP endpoints in
* TCPS_SYN_RECEIVED state when V_tcp_syncache.see_other is false.
- * Therefore, store the credentials and take a reference count only
- * when needed:
+ * Therefore, store the credentials only when needed:
* - sc is allocated from the zone and not using the on stack instance.
* - the sysctl variable net.inet.tcp.syncache.see_other is false.
* The reference count is decremented when a zone allocated sc is
* freed in syncache_free().
*/
- if (sc != &scs && !V_tcp_syncache.see_other)
- sc->sc_cred = crhold(so->so_cred);
- else
+ if (sc != &scs && !V_tcp_syncache.see_other) {
+ sc->sc_cred = cred;
+ cred = NULL;
+ } else
sc->sc_cred = NULL;
sc->sc_port = port;
sc->sc_ipopts = ipopts;
@@ -1783,6 +1785,8 @@ donenoprobe:
tcp_fastopen_decrement_counter(tfo_pending);
tfo_expanded:
+ if (cred != NULL)
+ crfree(cred);
if (sc == NULL || sc == &scs) {
#ifdef MAC
mac_syncache_destroy(&maclabel);
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 98c934955121..c4a54646f3a2 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -3088,7 +3088,8 @@ db_print_bblog_state(int state)
}
static void
-db_print_tcpcb(struct tcpcb *tp, const char *name, int indent, bool show_bblog)
+db_print_tcpcb(struct tcpcb *tp, const char *name, int indent, bool show_bblog,
+ bool show_inpcb)
{
db_print_indent(indent);
@@ -3096,6 +3097,9 @@ db_print_tcpcb(struct tcpcb *tp, const char *name, int indent, bool show_bblog)
indent += 2;
+ if (show_inpcb)
+ db_print_inpcb(tptoinpcb(tp), "t_inpcb", indent);
+
db_print_indent(indent);
db_printf("t_segq first: %p t_segqlen: %d t_dupacks: %d\n",
TAILQ_FIRST(&tp->t_segq), tp->t_segqlen, tp->t_dupacks);
@@ -3227,33 +3231,36 @@ db_print_tcpcb(struct tcpcb *tp, const char *name, int indent, bool show_bblog)
DB_SHOW_COMMAND(tcpcb, db_show_tcpcb)
{
struct tcpcb *tp;
- bool show_bblog;
+ bool show_bblog, show_inpcb;
if (!have_addr) {
- db_printf("usage: show tcpcb <addr>\n");
+ db_printf("usage: show tcpcb[/bi] <addr>\n");
return;
}
show_bblog = strchr(modif, 'b') != NULL;
+ show_inpcb = strchr(modif, 'i') != NULL;
tp = (struct tcpcb *)addr;
-
- db_print_tcpcb(tp, "tcpcb", 0, show_bblog);
+ db_print_tcpcb(tp, "tcpcb", 0, show_bblog, show_inpcb);
}
DB_SHOW_ALL_COMMAND(tcpcbs, db_show_all_tcpcbs)
{
VNET_ITERATOR_DECL(vnet_iter);
struct inpcb *inp;
- bool only_locked, show_bblog;
+ struct tcpcb *tp;
+ bool only_locked, show_bblog, show_inpcb;
only_locked = strchr(modif, 'l') != NULL;
show_bblog = strchr(modif, 'b') != NULL;
+ show_inpcb = strchr(modif, 'i') != NULL;
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter);
CK_LIST_FOREACH(inp, &V_tcbinfo.ipi_listhead, inp_list) {
if (only_locked &&
inp->inp_lock.rw_lock == RW_UNLOCKED)
continue;
- db_print_tcpcb(intotcpcb(inp), "tcpcb", 0, show_bblog);
+ tp = intotcpcb(inp);
+ db_print_tcpcb(tp, "tcpcb", 0, show_bblog, show_inpcb);
if (db_pager_quit)
break;
}