summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/netinet/tcp_subr.c16
-rw-r--r--sys/netinet/tcp_timer.c2
2 files changed, 7 insertions, 11 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index cb2d89a147a2..4de3e59917c9 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -385,17 +385,13 @@ tcpip_fillheaders(struct inpcb *inp, void *ip_ptr, void *tcp_ptr)
struct tcptemp *
tcpip_maketemplate(struct inpcb *inp)
{
- struct mbuf *m;
- struct tcptemp *n;
-
- m = m_get(M_DONTWAIT, MT_DATA);
- if (m == NULL)
- return (0);
- m->m_len = sizeof(struct tcptemp);
- n = mtod(m, struct tcptemp *);
+ struct tcptemp *t;
- tcpip_fillheaders(inp, (void *)&n->tt_ipgen, (void *)&n->tt_t);
- return (n);
+ t = malloc(sizeof(*t), M_TEMP, M_NOWAIT);
+ if (t == NULL)
+ return (NULL);
+ tcpip_fillheaders(inp, (void *)&t->tt_ipgen, (void *)&t->tt_t);
+ return (t);
}
/*
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index 765156eeaaf3..07db15693b95 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -313,7 +313,7 @@ tcp_timer_keep(void *xtp)
tcp_respond(tp, t_template->tt_ipgen,
&t_template->tt_t, (struct mbuf *)NULL,
tp->rcv_nxt, tp->snd_una - 1, 0);
- (void) m_free(dtom(t_template));
+ free(t_template, M_TEMP);
}
callout_reset(&tp->t_timers->tt_keep, tcp_keepintvl, tcp_timer_keep, tp);
} else