-#if TCP_COMPAT_42
- /*
- * The keepalive packet must have nonzero length
- * to get a 4.2 host to respond.
- */
-#if INET6
- if (isipv6)
- tcp_respond(tp, (void *)&tp->t_template->tt_i6,
- &tp->t_template->tt_t,
- (struct mbuf *)NULL,
- tp->rcv_nxt - 1, tp->snd_una - 1,
- 0, isipv6);
- else
-#endif /* INET6 */
- tcp_respond(tp, (void *)&tp->t_template->tt_i,
- &tp->t_template->tt_t, (struct mbuf *)NULL,
- tp->rcv_nxt - 1, tp->snd_una - 1, 0,
- isipv6);
-#else
-#if INET6
- if (isipv6)
- tcp_respond(tp, (void *)&tp->t_template->tt_i6,
- &tp->t_template->tt_t,
- (struct mbuf *)NULL, tp->rcv_nxt,
- tp->snd_una - 1, 0, isipv6);
- else
-#endif /* INET6 */
- tcp_respond(tp, (void *)&tp->t_template->tt_i,
- &tp->t_template->tt_t, (struct mbuf *)NULL,
- tp->rcv_nxt, tp->snd_una - 1, 0, isipv6);
-#endif
+ t_template = tcp_maketemplate(tp);
+ if (t_template) {
+ 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));
+ }