Netdev List
 help / color / mirror / Atom feed
* why we use skb->rt->rt_src as dest address when replying packet?
@ 2007-05-16 10:29 lepton
  0 siblings, 0 replies; only message in thread
From: lepton @ 2007-05-16 10:29 UTC (permalink / raw)
  To: netdev

I found in function [ip_send_reply] and [icmp_reply], we
use such code to get the destination address of our
packet:

struct rtable *rt = (struct rtable *)skb->dst;
......
daddr = ipc.addr = rt->rt_src;

I have a question here:
Is there any special reason for using rt->rt_src as destination address?
Can I use codes like these?

struct iph * ip = skb->nh.iph;
......
daddr = ipc.addr = ip->saddr;

I found in some case, rt->rt_src is not equal to ip->saddr. Thanks.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-16 10:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-16 10:29 why we use skb->rt->rt_src as dest address when replying packet? lepton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox