[Snort-devel] How can i extract the destination ip address from a packet??

Chris Green cmg at ...402...
Fri Apr 25 06:36:04 EDT 2003

abhishek nigam <anigam at ...1956...> writes:

> Hi, I was trying to use p->iph->ip_dst to get the destination ip
> address of a packet but it gives me the same ip address as the
> source.  Regards, Abhishek

Please display the code that you are using for that.

My guess is that it's

printf("%s <- %s", inet_ntoa(p->iph->ip_dst),

That doesn't work because inet_ntoa returns into a static buffer.

Chris Green <cmg at ...402...>
"Yeah, but you're taking the universe out of context."

More information about the Snort-devel mailing list