| To: | linux lover <linux_lover2004@xxxxxxxxx> |
|---|---|
| Subject: | Re: how ip header added in ip_bulid_xmit function? |
| From: | Manu Garg <manu.garg@xxxxxxxxxx> |
| Date: | Tue, 18 May 2004 19:53:16 +0530 |
| Cc: | linuxnet <linux-net@xxxxxxxxxxxxxxx>, netdev <netdev@xxxxxxxxxxx>, netfilter <netfilter-devel@xxxxxxxxxxxxxxxxxxx> |
| In-reply-to: | <20040518063106.85290.qmail@web90102.mail.scd.yahoo.com> |
| References: | <20040518063106.85290.qmail@web90102.mail.scd.yahoo.com> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| User-agent: | Mozilla Thunderbird 0.6 (Windows/20040502) |
linux lover wrote: hello ,A packet comes from TCP layer to IP layer through function call tp->af_specific->queue_xmit() (in tcp_output.c:tcp_transmit_skb() ). For IP this function is nothing but ip_queue_xmit() defined in ip_output.c. If you'll check this function, it clearly allocates ip header and put information in it. ---------------------------------------------------- iph = (struct iphdr *) skb_push(skb, sizeof(struct iphdr) + (opt ? opt->optlen : 0)); *((__u16 *)iph) = htons((4 << 12) | (5 << 8) | (sk->protinfo.af_inet.tos & 0xff)); iph->tot_len = htons(skb->len); if (ip_dont_fragment(sk, &rt->u.dst)) iph->frag_off = htons(IP_DF); else iph->frag_off = 0; iph->ttl = sk->protinfo.af_inet.ttl; iph->protocol = sk->protocol; iph->saddr = rt->rt_src; iph->daddr = rt->rt_dst; skb->nh.iph = iph; --------------------------------------------------- I hope this answers your question. regards, Manu Garg http://manugarg.freezope.org/notes |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | tracing calls of output(skb), linux lover |
|---|---|
| Next by Date: | Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default, Ricardo C Gonzalez |
| Previous by Thread: | how ip header added in ip_bulid_xmit function?, linux lover |
| Next by Thread: | Re: how ip header added in ip_bulid_xmit function?, linux lover |
| Indexes: | [Date] [Thread] [Top] [All Lists] |