From: Patrick McHardy <kaber@trash.net>
To: Andrea Rossato <mailing_list@istitutocolli.org>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: ECN target bug report
Date: Tue, 10 Dec 2002 19:17:19 +0100 [thread overview]
Message-ID: <3DF62FAF.9050908@trash.net> (raw)
In-Reply-To: <3DF6241A.9040404@istitutocolli.org>
Hi,
Andrea Rossato wrote:
> Patrick McHardy wrote:
>
>> the first attached patch fixes the issue you reported (verified),
>> altough i'm not entirely sure why ;).
>> the second one is untested but probably couldn't hurt neither.
>
>
> great patrick! faster then light!
>
> BTW, your second patch seems to imply that byte order is just a matter
> of taste ;)
>
> iph and tcph should give little endian int on i386 arch, so tons
> should be needed when writing to the sk_buff. but in computer
> programming there are misteries a lawyar will never be able to grasp...
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.
Bye,
Patrick
next prev parent reply other threads:[~2002-12-10 18:17 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 [this message]
2002-12-10 18:30 ` Andrea Rossato
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=3DF62FAF.9050908@trash.net \
--to=kaber@trash.net \
--cc=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.