From owner-freebsd-hackers Mon Oct 28 09:03:46 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id JAA11570 for hackers-outgoing; Mon, 28 Oct 1996 09:03:46 -0800 (PST) Received: from werty.wasantara.net.id (root@[202.159.71.178]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id JAA11537; Mon, 28 Oct 1996 09:03:09 -0800 (PST) Received: from bandung.wasantara.net.id (ws3bdg.wasantara.net.id [202.159.69.54]) by werty.wasantara.net.id (8.6.11/8.6.9) with SMTP id AAA02710; Tue, 29 Oct 1996 00:03:16 +0700 Date: Tue, 29 Oct 1996 00:03:16 +0700 Message-Id: <199610281703.AAA02710@werty.wasantara.net.id> X-Sender: eka@werty.wasantara.net.id (Unverified) X-Mailer: Windows Eudora Light Version 1.5.2 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: freebsd-hackers@FreeBSD.org From: Eka Kelana Subject: tcp_output.c Cc: freebsd-questions@FreeBSD.org Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Hi... I want to know what these lines (with "???" mark) do in tcp output (tcp_output.c) routine: /* * Fill in IP length and desired time to live and * send to IP level. There should be a better way * to handle ttl and tos; we could keep them in * the template, but need a way to checksum without them. */ m->m_pkthdr.len = hdrlen + len; #ifdef TUBA if (tp->t_tuba_pcb) error = tuba_output(m, tp); else #endif { ??? ((struct ip *)ti)->ip_len = m->m_pkthdr.len; ??? ((struct ip *)ti)->ip_ttl = tp->t_inpcb->inp_ip.ip_ttl; /* XXX */ ??? ((struct ip *)ti)->ip_tos = tp->t_inpcb->inp_ip.ip_tos; /* XXX */ #if BSD >= 43 error = ip_output(m, tp->t_inpcb->inp_options, &tp->t_inpcb->inp_route, so->so_options & SO_DONTROUTE, 0); #else error = ip_output(m, (struct mbuf *)0, &tp->t_inpcb->inp_route, so->so_options & SO_DONTROUTE); #endif } Why should ti (tcpiphdr structure) be casted to ip header structure and being filled in this tcp routine? Why don't we just fill the ip header in ip routine? What is it intended for? -Eka Kelana-