From: Aviv Greenberg <deca@netvision.net.il>
To: linux-kernel@vger.kernel.org
Subject: TCP_IPV4_MATCH macro
Date: Tue, 28 Aug 2001 17:43:58 +0300 [thread overview]
Message-ID: <01082817435800.06072@aviv_linuxddd> (raw)
In tcp.h line 238 :
#define TCP_IPV4_MATCH(__sk, __cookie, __saddr, __daddr, __ports, __dif)\
(((__sk)->daddr == (__saddr)) && \
((__sk)->rcv_saddr == (__daddr)) && \
((*((__u32 *)&((__sk)->dport)))== (__ports)) && \
(!((__sk)->bound_dev_if) || ((__sk)->bound_dev_if == (__dif))))
the ((*((__u32 *)&((__sk)->dport))) part is nasty because it assumes that the
next field in the structure is 'num'. Why not use the TCP_COMBINED_PORTS
for that.? There are other such nasties in the macros there.
An alternative would be a nice comment in the sock structure.
Alexey ? DaveM ? Someone ? :)
--
- Aviv Greeberg
reply other threads:[~2001-08-28 14:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=01082817435800.06072@aviv_linuxddd \
--to=deca@netvision.net.il \
--cc=linux-kernel@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