... they haven't been used since 2006. OK?
(This is on top of "convert frag6 to mutex", but the order doesn't matter, the conflict is trivial) diff --git netinet/in_proto.c netinet/in_proto.c index 6efbac7da5c..2667bba6124 100644 --- netinet/in_proto.c +++ netinet/in_proto.c @@ -179,7 +179,6 @@ struct protosw inetsw[] = { .pr_domain = &inetdomain, .pr_init = ip_init, .pr_slowtimo = ip_slowtimo, - .pr_drain = ip_drain, .pr_sysctl = ip_sysctl }, { diff --git netinet/ip_input.c netinet/ip_input.c index c02e95de474..fbf313bf2aa 100644 --- netinet/ip_input.c +++ netinet/ip_input.c @@ -1038,20 +1038,6 @@ ip_slowtimo(void) mtx_leave(&ipq_mutex); } -/* - * Drain off all datagram fragments. - */ -void -ip_drain(void) -{ - mtx_enter(&ipq_mutex); - while (!LIST_EMPTY(&ipq)) { - ipstat_inc(ips_fragdropped); - ip_freef(LIST_FIRST(&ipq)); - } - mtx_leave(&ipq_mutex); -} - /* * Flush a bunch of datagram fragments, till we are down to 75%. */ diff --git netinet/ip_var.h netinet/ip_var.h index 26429f9be08..5aff237e66c 100644 --- netinet/ip_var.h +++ netinet/ip_var.h @@ -216,7 +216,6 @@ struct route; struct inpcb; int ip_ctloutput(int, struct socket *, int, int, struct mbuf *); -void ip_drain(void); void ip_flush(void); int ip_fragment(struct mbuf *, struct ifnet *, u_long); void ip_freef(struct ipq *); diff --git netinet6/frag6.c netinet6/frag6.c index 390115106c5..4a184b62c31 100644 --- netinet6/frag6.c +++ netinet6/frag6.c @@ -580,20 +580,3 @@ frag6_slowtimo(void) } mtx_leave(&ip6q_mutex); } - -/* - * Drain off all datagram fragments. - */ -void -frag6_drain(void) -{ - struct ip6q *q6; - - if (mtx_enter_try(&ip6q_mutex) == 0) - return; - while ((q6 = TAILQ_FIRST(&frag6_queue)) != NULL) { - ip6stat_inc(ip6s_fragdropped); - frag6_freef(q6); - } - mtx_leave(&ip6q_mutex); -} diff --git netinet6/in6_proto.c netinet6/in6_proto.c index a112d731163..34d51630e1b 100644 --- netinet6/in6_proto.c +++ netinet6/in6_proto.c @@ -127,7 +127,6 @@ struct protosw inet6sw[] = { .pr_protocol = IPPROTO_IPV6, .pr_init = ip6_init, .pr_slowtimo = frag6_slowtimo, - .pr_drain = frag6_drain, .pr_sysctl = ip6_sysctl }, { diff --git netinet6/ip6_var.h netinet6/ip6_var.h index 09dd373bc3e..183091786e1 100644 --- netinet6/ip6_var.h +++ netinet6/ip6_var.h @@ -334,7 +334,6 @@ void frag6_init(void); int frag6_input(struct mbuf **, int *, int, int); int frag6_deletefraghdr(struct mbuf *, int); void frag6_slowtimo(void); -void frag6_drain(void); void rip6_init(void); int rip6_input(struct mbuf **, int *, int, int); diff --git sys/protosw.h sys/protosw.h index 4dd57001f7d..595ca1e00a3 100644 --- sys/protosw.h +++ sys/protosw.h @@ -41,8 +41,6 @@ * A protocol is called through the pr_init entry before any other. * Thereafter it is called every 200ms through the pr_fasttimo entry and * every 500ms through the pr_slowtimo for timer based actions. - * The system will call the pr_drain entry if it is low on space and - * this should throw away any non-critical data. * * Protocols pass data between themselves as chains of mbufs using * the pr_input and pr_output hooks. Pr_input passes data up (towards @@ -90,7 +88,6 @@ struct protosw { void (*pr_init)(void); /* initialization hook */ void (*pr_fasttimo)(void); /* fast timeout (200ms) */ void (*pr_slowtimo)(void); /* slow timeout (500ms) */ - void (*pr_drain)(void); /* flush any excess space possible */ /* sysctl for protocol */ int (*pr_sysctl)(int *, u_int, void *, size_t *, void *, size_t); }; -- I'm not entirely sure you are real.