1 /* 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. All advertising materials mentioning features or use of this software 14 * must display the following acknowledgement: 15 * This product includes software developed by the University of 16 * California, Berkeley and its contributors. 17 * 4. Neither the name of the University nor the names of its contributors 18 * may be used to endorse or promote products derived from this software 19 * without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 34 * $Id: tcp_subr.c,v 1.30 1996/06/14 17:17:32 wollman Exp $ 35 */ 36 37 #include <sys/param.h> 38 #include <sys/queue.h> 39 #include <sys/proc.h> 40 #include <sys/systm.h> 41 #include <sys/kernel.h> 42 #include <sys/sysctl.h> 43 #include <sys/malloc.h> 44 #include <sys/mbuf.h> 45 #include <sys/socket.h> 46 #include <sys/socketvar.h> 47 #include <sys/protosw.h> 48 #include <sys/errno.h> 49 50 #include <net/route.h> 51 #include <net/if.h> 52 53 #define _IP_VHL 54 #include <netinet/in.h> 55 #include <netinet/in_systm.h> 56 #include <netinet/ip.h> 57 #include <netinet/in_pcb.h> 58 #include <netinet/in_var.h> 59 #include <netinet/ip_var.h> 60 #include <netinet/ip_icmp.h> 61 #include <netinet/tcp.h> 62 #include <netinet/tcp_fsm.h> 63 #include <netinet/tcp_seq.h> 64 #include <netinet/tcp_timer.h> 65 #include <netinet/tcp_var.h> 66 #include <netinet/tcpip.h> 67 #ifdef TCPDEBUG 68 #include <netinet/tcp_debug.h> 69 #endif 70 71 int tcp_mssdflt = TCP_MSS; 72 SYSCTL_INT(_net_inet_tcp, TCPCTL_MSSDFLT, mssdflt, 73 CTLFLAG_RW, &tcp_mssdflt , 0, ""); 74 75 static int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ; 76 SYSCTL_INT(_net_inet_tcp, TCPCTL_RTTDFLT, rttdflt, 77 CTLFLAG_RW, &tcp_rttdflt , 0, ""); 78 79 static int tcp_do_rfc1323 = 1; 80 SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1323, rfc1323, 81 CTLFLAG_RW, &tcp_do_rfc1323 , 0, ""); 82 83 static int tcp_do_rfc1644 = 1; 84 SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1644, rfc1644, 85 CTLFLAG_RW, &tcp_do_rfc1644 , 0, ""); 86 87 static void tcp_cleartaocache(void); 88 static void tcp_notify __P((struct inpcb *, int)); 89 90 /* 91 * Target size of TCP PCB hash table. Will be rounded down to a prime 92 * number. 93 */ 94 #ifndef TCBHASHSIZE 95 #define TCBHASHSIZE 128 96 #endif 97 98 /* 99 * Tcp initialization 100 */ 101 void 102 tcp_init() 103 { 104 105 tcp_iss = random(); /* wrong, but better than a constant */ 106 tcp_ccgen = 1; 107 tcp_cleartaocache(); 108 LIST_INIT(&tcb); 109 tcbinfo.listhead = &tcb; 110 tcbinfo.hashbase = phashinit(TCBHASHSIZE, M_PCB, &tcbinfo.hashsize); 111 if (max_protohdr < sizeof(struct tcpiphdr)) 112 max_protohdr = sizeof(struct tcpiphdr); 113 if (max_linkhdr + sizeof(struct tcpiphdr) > MHLEN) 114 panic("tcp_init"); 115 } 116 117 /* 118 * Create template to be used to send tcp packets on a connection. 119 * Call after host entry created, allocates an mbuf and fills 120 * in a skeletal tcp/ip header, minimizing the amount of work 121 * necessary when the connection is used. 122 */ 123 struct tcpiphdr * 124 tcp_template(tp) 125 struct tcpcb *tp; 126 { 127 register struct inpcb *inp = tp->t_inpcb; 128 register struct mbuf *m; 129 register struct tcpiphdr *n; 130 131 if ((n = tp->t_template) == 0) { 132 m = m_get(M_DONTWAIT, MT_HEADER); 133 if (m == NULL) 134 return (0); 135 m->m_len = sizeof (struct tcpiphdr); 136 n = mtod(m, struct tcpiphdr *); 137 } 138 n->ti_next = n->ti_prev = 0; 139 n->ti_x1 = 0; 140 n->ti_pr = IPPROTO_TCP; 141 n->ti_len = htons(sizeof (struct tcpiphdr) - sizeof (struct ip)); 142 n->ti_src = inp->inp_laddr; 143 n->ti_dst = inp->inp_faddr; 144 n->ti_sport = inp->inp_lport; 145 n->ti_dport = inp->inp_fport; 146 n->ti_seq = 0; 147 n->ti_ack = 0; 148 n->ti_x2 = 0; 149 n->ti_off = 5; 150 n->ti_flags = 0; 151 n->ti_win = 0; 152 n->ti_sum = 0; 153 n->ti_urp = 0; 154 return (n); 155 } 156 157 /* 158 * Send a single message to the TCP at address specified by 159 * the given TCP/IP header. If m == 0, then we make a copy 160 * of the tcpiphdr at ti and send directly to the addressed host. 161 * This is used to force keep alive messages out using the TCP 162 * template for a connection tp->t_template. If flags are given 163 * then we send a message back to the TCP which originated the 164 * segment ti, and discard the mbuf containing it and any other 165 * attached mbufs. 166 * 167 * In any case the ack and sequence number of the transmitted 168 * segment are as specified by the parameters. 169 */ 170 void 171 tcp_respond(tp, ti, m, ack, seq, flags) 172 struct tcpcb *tp; 173 register struct tcpiphdr *ti; 174 register struct mbuf *m; 175 tcp_seq ack, seq; 176 int flags; 177 { 178 register int tlen; 179 int win = 0; 180 struct route *ro = 0; 181 struct route sro; 182 183 if (tp) { 184 win = sbspace(&tp->t_inpcb->inp_socket->so_rcv); 185 ro = &tp->t_inpcb->inp_route; 186 } else { 187 ro = &sro; 188 bzero(ro, sizeof *ro); 189 } 190 if (m == 0) { 191 m = m_gethdr(M_DONTWAIT, MT_HEADER); 192 if (m == NULL) 193 return; 194 #ifdef TCP_COMPAT_42 195 tlen = 1; 196 #else 197 tlen = 0; 198 #endif 199 m->m_data += max_linkhdr; 200 *mtod(m, struct tcpiphdr *) = *ti; 201 ti = mtod(m, struct tcpiphdr *); 202 flags = TH_ACK; 203 } else { 204 m_freem(m->m_next); 205 m->m_next = 0; 206 m->m_data = (caddr_t)ti; 207 m->m_len = sizeof (struct tcpiphdr); 208 tlen = 0; 209 #define xchg(a,b,type) { type t; t=a; a=b; b=t; } 210 xchg(ti->ti_dst.s_addr, ti->ti_src.s_addr, u_long); 211 xchg(ti->ti_dport, ti->ti_sport, u_short); 212 #undef xchg 213 } 214 ti->ti_len = htons((u_short)(sizeof (struct tcphdr) + tlen)); 215 tlen += sizeof (struct tcpiphdr); 216 m->m_len = tlen; 217 m->m_pkthdr.len = tlen; 218 m->m_pkthdr.rcvif = (struct ifnet *) 0; 219 ti->ti_next = ti->ti_prev = 0; 220 ti->ti_x1 = 0; 221 ti->ti_seq = htonl(seq); 222 ti->ti_ack = htonl(ack); 223 ti->ti_x2 = 0; 224 ti->ti_off = sizeof (struct tcphdr) >> 2; 225 ti->ti_flags = flags; 226 if (tp) 227 ti->ti_win = htons((u_short) (win >> tp->rcv_scale)); 228 else 229 ti->ti_win = htons((u_short)win); 230 ti->ti_urp = 0; 231 ti->ti_sum = 0; 232 ti->ti_sum = in_cksum(m, tlen); 233 ((struct ip *)ti)->ip_len = tlen; 234 ((struct ip *)ti)->ip_ttl = ip_defttl; 235 #ifdef TCPDEBUG 236 if (tp == NULL || (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) 237 tcp_trace(TA_OUTPUT, 0, tp, ti, 0); 238 #endif 239 (void) ip_output(m, NULL, ro, 0, NULL); 240 if (ro == &sro && ro->ro_rt) { 241 RTFREE(ro->ro_rt); 242 } 243 } 244 245 /* 246 * Create a new TCP control block, making an 247 * empty reassembly queue and hooking it to the argument 248 * protocol control block. 249 */ 250 struct tcpcb * 251 tcp_newtcpcb(inp) 252 struct inpcb *inp; 253 { 254 register struct tcpcb *tp; 255 256 tp = malloc(sizeof(*tp), M_PCB, M_NOWAIT); 257 if (tp == NULL) 258 return ((struct tcpcb *)0); 259 bzero((char *) tp, sizeof(struct tcpcb)); 260 tp->seg_next = tp->seg_prev = (struct tcpiphdr *)tp; 261 tp->t_maxseg = tp->t_maxopd = tcp_mssdflt; 262 263 if (tcp_do_rfc1323) 264 tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP); 265 if (tcp_do_rfc1644) 266 tp->t_flags |= TF_REQ_CC; 267 tp->t_inpcb = inp; 268 /* 269 * Init srtt to TCPTV_SRTTBASE (0), so we can tell that we have no 270 * rtt estimate. Set rttvar so that srtt + 4 * rttvar gives 271 * reasonable initial retransmit time. 272 */ 273 tp->t_srtt = TCPTV_SRTTBASE; 274 tp->t_rttvar = ((TCPTV_RTOBASE - TCPTV_SRTTBASE) << TCP_RTTVAR_SHIFT) / 4; 275 tp->t_rttmin = TCPTV_MIN; 276 tp->t_rxtcur = TCPTV_RTOBASE; 277 tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT; 278 tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT; 279 inp->inp_ip.ip_ttl = ip_defttl; 280 inp->inp_ppcb = (caddr_t)tp; 281 return (tp); 282 } 283 284 /* 285 * Drop a TCP connection, reporting 286 * the specified error. If connection is synchronized, 287 * then send a RST to peer. 288 */ 289 struct tcpcb * 290 tcp_drop(tp, errno) 291 register struct tcpcb *tp; 292 int errno; 293 { 294 struct socket *so = tp->t_inpcb->inp_socket; 295 296 if (TCPS_HAVERCVDSYN(tp->t_state)) { 297 tp->t_state = TCPS_CLOSED; 298 (void) tcp_output(tp); 299 tcpstat.tcps_drops++; 300 } else 301 tcpstat.tcps_conndrops++; 302 if (errno == ETIMEDOUT && tp->t_softerror) 303 errno = tp->t_softerror; 304 so->so_error = errno; 305 return (tcp_close(tp)); 306 } 307 308 /* 309 * Close a TCP control block: 310 * discard all space held by the tcp 311 * discard internet protocol block 312 * wake up any sleepers 313 */ 314 struct tcpcb * 315 tcp_close(tp) 316 register struct tcpcb *tp; 317 { 318 register struct tcpiphdr *t; 319 struct inpcb *inp = tp->t_inpcb; 320 struct socket *so = inp->inp_socket; 321 register struct mbuf *m; 322 register struct rtentry *rt; 323 324 /* 325 * If we got enough samples through the srtt filter, 326 * save the rtt and rttvar in the routing entry. 327 * 'Enough' is arbitrarily defined as the 16 samples. 328 * 16 samples is enough for the srtt filter to converge 329 * to within 5% of the correct value; fewer samples and 330 * we could save a very bogus rtt. 331 * 332 * Don't update the default route's characteristics and don't 333 * update anything that the user "locked". 334 */ 335 if (tp->t_rttupdated >= 16 && 336 (rt = inp->inp_route.ro_rt) && 337 ((struct sockaddr_in *)rt_key(rt))->sin_addr.s_addr != INADDR_ANY) { 338 register u_long i = 0; 339 340 if ((rt->rt_rmx.rmx_locks & RTV_RTT) == 0) { 341 i = tp->t_srtt * 342 (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTT_SCALE)); 343 if (rt->rt_rmx.rmx_rtt && i) 344 /* 345 * filter this update to half the old & half 346 * the new values, converting scale. 347 * See route.h and tcp_var.h for a 348 * description of the scaling constants. 349 */ 350 rt->rt_rmx.rmx_rtt = 351 (rt->rt_rmx.rmx_rtt + i) / 2; 352 else 353 rt->rt_rmx.rmx_rtt = i; 354 tcpstat.tcps_cachedrtt++; 355 } 356 if ((rt->rt_rmx.rmx_locks & RTV_RTTVAR) == 0) { 357 i = tp->t_rttvar * 358 (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTTVAR_SCALE)); 359 if (rt->rt_rmx.rmx_rttvar && i) 360 rt->rt_rmx.rmx_rttvar = 361 (rt->rt_rmx.rmx_rttvar + i) / 2; 362 else 363 rt->rt_rmx.rmx_rttvar = i; 364 tcpstat.tcps_cachedrttvar++; 365 } 366 /* 367 * update the pipelimit (ssthresh) if it has been updated 368 * already or if a pipesize was specified & the threshhold 369 * got below half the pipesize. I.e., wait for bad news 370 * before we start updating, then update on both good 371 * and bad news. 372 */ 373 if (((rt->rt_rmx.rmx_locks & RTV_SSTHRESH) == 0 && 374 ((i = tp->snd_ssthresh) != 0) && rt->rt_rmx.rmx_ssthresh) || 375 i < (rt->rt_rmx.rmx_sendpipe / 2)) { 376 /* 377 * convert the limit from user data bytes to 378 * packets then to packet data bytes. 379 */ 380 i = (i + tp->t_maxseg / 2) / tp->t_maxseg; 381 if (i < 2) 382 i = 2; 383 i *= (u_long)(tp->t_maxseg + sizeof (struct tcpiphdr)); 384 if (rt->rt_rmx.rmx_ssthresh) 385 rt->rt_rmx.rmx_ssthresh = 386 (rt->rt_rmx.rmx_ssthresh + i) / 2; 387 else 388 rt->rt_rmx.rmx_ssthresh = i; 389 tcpstat.tcps_cachedssthresh++; 390 } 391 } 392 /* free the reassembly queue, if any */ 393 t = tp->seg_next; 394 while (t != (struct tcpiphdr *)tp) { 395 t = (struct tcpiphdr *)t->ti_next; 396 m = REASS_MBUF((struct tcpiphdr *)t->ti_prev); 397 remque(t->ti_prev); 398 m_freem(m); 399 } 400 if (tp->t_template) 401 (void) m_free(dtom(tp->t_template)); 402 free(tp, M_PCB); 403 inp->inp_ppcb = 0; 404 soisdisconnected(so); 405 in_pcbdetach(inp); 406 tcpstat.tcps_closed++; 407 return ((struct tcpcb *)0); 408 } 409 410 void 411 tcp_drain() 412 { 413 414 } 415 416 /* 417 * Notify a tcp user of an asynchronous error; 418 * store error as soft error, but wake up user 419 * (for now, won't do anything until can select for soft error). 420 */ 421 static void 422 tcp_notify(inp, error) 423 struct inpcb *inp; 424 int error; 425 { 426 register struct tcpcb *tp = (struct tcpcb *)inp->inp_ppcb; 427 register struct socket *so = inp->inp_socket; 428 429 /* 430 * Ignore some errors if we are hooked up. 431 * If connection hasn't completed, has retransmitted several times, 432 * and receives a second error, give up now. This is better 433 * than waiting a long time to establish a connection that 434 * can never complete. 435 */ 436 if (tp->t_state == TCPS_ESTABLISHED && 437 (error == EHOSTUNREACH || error == ENETUNREACH || 438 error == EHOSTDOWN)) { 439 return; 440 } else if (tp->t_state < TCPS_ESTABLISHED && tp->t_rxtshift > 3 && 441 tp->t_softerror) 442 so->so_error = error; 443 else 444 tp->t_softerror = error; 445 wakeup((caddr_t) &so->so_timeo); 446 sorwakeup(so); 447 sowwakeup(so); 448 } 449 450 void 451 tcp_ctlinput(cmd, sa, vip) 452 int cmd; 453 struct sockaddr *sa; 454 void *vip; 455 { 456 register struct ip *ip = vip; 457 register struct tcphdr *th; 458 void (*notify) __P((struct inpcb *, int)) = tcp_notify; 459 460 if (cmd == PRC_QUENCH) 461 notify = tcp_quench; 462 #if 1 463 else if (cmd == PRC_MSGSIZE) 464 notify = tcp_mtudisc; 465 #endif 466 else if (!PRC_IS_REDIRECT(cmd) && 467 ((unsigned)cmd > PRC_NCMDS || inetctlerrmap[cmd] == 0)) 468 return; 469 if (ip) { 470 th = (struct tcphdr *)((caddr_t)ip 471 + (IP_VHL_HL(ip->ip_vhl) << 2)); 472 in_pcbnotify(&tcb, sa, th->th_dport, ip->ip_src, th->th_sport, 473 cmd, notify); 474 } else 475 in_pcbnotify(&tcb, sa, 0, zeroin_addr, 0, cmd, notify); 476 } 477 478 /* 479 * When a source quench is received, close congestion window 480 * to one segment. We will gradually open it again as we proceed. 481 */ 482 void 483 tcp_quench(inp, errno) 484 struct inpcb *inp; 485 int errno; 486 { 487 struct tcpcb *tp = intotcpcb(inp); 488 489 if (tp) 490 tp->snd_cwnd = tp->t_maxseg; 491 } 492 493 #if 1 494 /* 495 * When `need fragmentation' ICMP is received, update our idea of the MSS 496 * based on the new value in the route. Also nudge TCP to send something, 497 * since we know the packet we just sent was dropped. 498 * This duplicates some code in the tcp_mss() function in tcp_input.c. 499 */ 500 void 501 tcp_mtudisc(inp, errno) 502 struct inpcb *inp; 503 int errno; 504 { 505 struct tcpcb *tp = intotcpcb(inp); 506 struct rtentry *rt; 507 struct rmxp_tao *taop; 508 struct socket *so = inp->inp_socket; 509 int offered; 510 int mss; 511 512 if (tp) { 513 rt = tcp_rtlookup(inp); 514 if (!rt || !rt->rt_rmx.rmx_mtu) { 515 tp->t_maxopd = tp->t_maxseg = tcp_mssdflt; 516 return; 517 } 518 taop = rmx_taop(rt->rt_rmx); 519 offered = taop->tao_mssopt; 520 mss = rt->rt_rmx.rmx_mtu - sizeof(struct tcpiphdr); 521 if (offered) 522 mss = min(mss, offered); 523 /* 524 * XXX - The above conditional probably violates the TCP 525 * spec. The problem is that, since we don't know the 526 * other end's MSS, we are supposed to use a conservative 527 * default. But, if we do that, then MTU discovery will 528 * never actually take place, because the conservative 529 * default is much less than the MTUs typically seen 530 * on the Internet today. For the moment, we'll sweep 531 * this under the carpet. 532 * 533 * The conservative default might not actually be a problem 534 * if the only case this occurs is when sending an initial 535 * SYN with options and data to a host we've never talked 536 * to before. Then, they will reply with an MSS value which 537 * will get recorded and the new parameters should get 538 * recomputed. For Further Study. 539 */ 540 if (tp->t_maxopd <= mss) 541 return; 542 tp->t_maxopd = mss; 543 544 if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP && 545 (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP) 546 mss -= TCPOLEN_TSTAMP_APPA; 547 if ((tp->t_flags & (TF_REQ_CC|TF_NOOPT)) == TF_REQ_CC && 548 (tp->t_flags & TF_RCVD_CC) == TF_RCVD_CC) 549 mss -= TCPOLEN_CC_APPA; 550 #if (MCLBYTES & (MCLBYTES - 1)) == 0 551 if (mss > MCLBYTES) 552 mss &= ~(MCLBYTES-1); 553 #else 554 if (mss > MCLBYTES) 555 mss = mss / MCLBYTES * MCLBYTES; 556 #endif 557 if (so->so_snd.sb_hiwat < mss) 558 mss = so->so_snd.sb_hiwat; 559 560 tp->t_maxseg = mss; 561 562 tcpstat.tcps_mturesent++; 563 tp->t_rtt = 0; 564 tp->snd_nxt = tp->snd_una; 565 tcp_output(tp); 566 } 567 } 568 #endif 569 570 /* 571 * Look-up the routing entry to the peer of this inpcb. If no route 572 * is found and it cannot be allocated the return NULL. This routine 573 * is called by TCP routines that access the rmx structure and by tcp_mss 574 * to get the interface MTU. 575 */ 576 struct rtentry * 577 tcp_rtlookup(inp) 578 struct inpcb *inp; 579 { 580 struct route *ro; 581 struct rtentry *rt; 582 583 ro = &inp->inp_route; 584 rt = ro->ro_rt; 585 if (rt == NULL || !(rt->rt_flags & RTF_UP)) { 586 /* No route yet, so try to acquire one */ 587 if (inp->inp_faddr.s_addr != INADDR_ANY) { 588 ro->ro_dst.sa_family = AF_INET; 589 ro->ro_dst.sa_len = sizeof(ro->ro_dst); 590 ((struct sockaddr_in *) &ro->ro_dst)->sin_addr = 591 inp->inp_faddr; 592 rtalloc(ro); 593 rt = ro->ro_rt; 594 } 595 } 596 return rt; 597 } 598 599 /* 600 * Return a pointer to the cached information about the remote host. 601 * The cached information is stored in the protocol specific part of 602 * the route metrics. 603 */ 604 struct rmxp_tao * 605 tcp_gettaocache(inp) 606 struct inpcb *inp; 607 { 608 struct rtentry *rt = tcp_rtlookup(inp); 609 610 /* Make sure this is a host route and is up. */ 611 if (rt == NULL || 612 (rt->rt_flags & (RTF_UP|RTF_HOST)) != (RTF_UP|RTF_HOST)) 613 return NULL; 614 615 return rmx_taop(rt->rt_rmx); 616 } 617 618 /* 619 * Clear all the TAO cache entries, called from tcp_init. 620 * 621 * XXX 622 * This routine is just an empty one, because we assume that the routing 623 * routing tables are initialized at the same time when TCP, so there is 624 * nothing in the cache left over. 625 */ 626 static void 627 tcp_cleartaocache(void) 628 { } 629