From: Andrea Rossato <mailing_list@istitutocolli.org>
To: netfilter-devel@lists.netfilter.org
Subject: Re: ECN target bug report
Date: Tue, 10 Dec 2002 19:30:15 +0100 [thread overview]
Message-ID: <3DF632B7.2080108@istitutocolli.org> (raw)
In-Reply-To: <3DF62FAF.9050908@trash.net>
Patrick McHardy wrote:
> I thought calculating checksum for x and htons(x) should give me same
> result, obiously that is wrong (which i learned after trying it out).
> For the first patch: *tcpflags are bitfields (position declared
> dependant of endianess), so no htons here.
> For the second patch, it's working with or without, although i think the
> correct way is with the patch:
>
> u_int16_t diffs[2];
> diffs[0] = htons(iph->tos) ^ 0xFFFF;
> ...
> diffs[1] = htons(iph->tos);
> ...
>
> iph->tos is of type u_int8_t. so no htons is necessary.
I know netiquette suggest not to send messages just to thank...but i
spet the whole afternoon trying to understand when exactly host-to-net
byte order translation was needed without results!
Now I've got it!!
Thanks,
andrea
next prev parent reply other threads:[~2002-12-10 18:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-07 13:14 ECN target bug report Andrea Rossato
2002-12-09 10:13 ` Andrea Rossato
2002-12-09 12:07 ` Andrea Rossato
2002-12-09 16:23 ` Andrea Rossato
2002-12-09 16:37 ` Andrea Rossato
2002-12-09 21:19 ` Andrea Rossato
2002-12-09 23:02 ` Patrick McHardy
2002-12-10 17:27 ` Andrea Rossato
2002-12-10 18:17 ` Patrick McHardy
2002-12-10 18:30 ` Andrea Rossato [this message]
2003-01-02 9:03 ` Harald Welte
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=3DF632B7.2080108@istitutocolli.org \
--to=mailing_list@istitutocolli.org \
--cc=netfilter-devel@lists.netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.