netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jeff Saremi" <jeffsaremi@yahoo.com>
To: 'Jan Engelhardt' <jengelh@medozas.de>
Cc: netfilter@vger.kernel.org
Subject: RE: SO_ORIGINAL_DST returning bogus port number
Date: Mon, 19 Apr 2010 17:30:03 -0400	[thread overview]
Message-ID: <004301cae007$791f2e80$6b5d8b80$@com> (raw)
In-Reply-To: <alpine.LSU.2.01.1004192212420.30616@obet.zrqbmnf.qr>

Thanks a lot for responding.
The key was " ntohs()" which i didn't have and you mentioned. It works properly now.

>
>You have to use
>
>else {
>	char buf[16];
>	inet_ntop(AF_INET, &dst_addr.sin_addr, dst, sizeof(dst));
                                               ^ buf, not dst

>	printf("%s:%hu\n", buf, ntohs(dst_addr.sin_port));
>}


      reply	other threads:[~2010-04-19 21:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-19 19:36 SO_ORIGINAL_DST returning bogus port number Jeff Saremi
2010-04-19 20:09 ` Jan Engelhardt
2010-04-19 20:12   ` Jan Engelhardt
2010-04-19 21:30     ` Jeff Saremi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='004301cae007$791f2e80$6b5d8b80$@com' \
    --to=jeffsaremi@yahoo.com \
    --cc=jengelh@medozas.de \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).