From: Patrick Schaaf <bof@bof.de>
To: "David S. Miller" <davem@davemloft.net>
Cc: netfilter-devel@lists.netfilter.org, kaber@trash.net
Subject: Re: [PATCH] owner-socketlookup update for 2.6.12-rc3
Date: Wed, 27 Apr 2005 08:43:04 +0200 [thread overview]
Message-ID: <20050427064304.GA5828@oknodo.bof.de> (raw)
In-Reply-To: <20050426231328.0ab5b357.davem@davemloft.net>
> It still hurts my eyes to see the tcp_tw_bucket internals being
> referenced in netfilter code :-)
Is it even correct to make an exception (return 0, i.e. do not match)
when a TW socket is hit? Conceptually, a TW socket is the same logical
entity as its former "established and owned" socket - wouldn't one
expect a rule accepting the established socket, to also match that
socket in the TW phase?
> Or even:
>
> extern struct sock *ip_lookup_socket(saddr, sport, daddr, dport);
>
> And this new function knows TCP internals and does not return
> time-wait sockets and stuff like that.
Hmm. In the light of the above, what about this:
int ip_socket_owner(struct sockowner *so, prot, src, sport, dst, dport) {}
with the 'struct sockowner *' an OUT parameter that is to be filled,
and boolean found/notfound return.
struct sockowner {
... contains whatever the owner match needs to look at
};
This way, no sock internals need to be visible to the owner match.
To solve the mentioned conceptional TW problem, the tw sock must
be extended
struct sockowner *tw_ownerinfo;
and, for performance reasons, the normal sock would probably need
a single DID_OWNER state bit, which would be set whenever the normal
sock is queried by ip_socket_owner(). Finally, when the normal sock
morphs into the tw sock, set
tw_ownerinfo = sk->DID_OWNER ? X(sk) : 0
with X(sk) kmalloc()ing a struct sockowner, and initializing it like
a call to ip_socket_owner() would.
Very convoluted, but what good is a matching feature that only
sometimes works?
(or maybe I'm just silly?)
best regards
Patrick
next prev parent reply other threads:[~2005-04-27 6:43 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-27 4:22 Status of owner-socketlookup James Morris
2005-04-27 4:22 ` David S. Miller
2005-04-27 4:44 ` James Morris
2005-04-27 10:09 ` Patrick McHardy
2005-04-27 13:59 ` James Morris
2005-04-27 14:04 ` Patrick McHardy
2005-04-27 18:47 ` David S. Miller
2005-04-27 14:40 ` Juha Heljoranta
2005-04-27 14:52 ` Patrick McHardy
2005-04-27 18:49 ` David S. Miller
2005-04-27 19:37 ` Patrick McHardy
2005-04-27 22:43 ` James Morris
2005-05-10 15:59 ` Netfilter socket hooks (was: Re: Status of owner-socketlookup) Patrick McHardy
2005-05-10 16:00 ` [netfilter socket hooks 1/5]: Add socket hook infrastructure Patrick McHardy
2005-05-11 23:22 ` James Morris
2005-05-11 23:27 ` James Morris
2005-05-11 23:27 ` Patrick McHardy
2005-05-10 16:00 ` [netfilter socket hooks 2/5]: Add protocol hooks Patrick McHardy
2005-05-10 16:01 ` [netfilter socket hooks 3/5]: Add struct sock * argument to ipt_do_table() Patrick McHardy
2005-05-10 16:01 ` [netfilter socket hooks 4/5]: Add struct sock * argument to match functions Patrick McHardy
2005-05-10 16:01 ` [netfilter socket hooks 5/5]: Add skfilter table Patrick McHardy
2005-05-10 18:26 ` Netfilter socket hooks (was: Re: Status of owner-socketlookup) James Morris
2005-05-10 20:37 ` Netfilter socket hooks Jonas Berlin
2005-05-11 0:04 ` David S. Miller
2005-05-11 23:57 ` Netfilter socket hooks (was: Re: Status of owner-socketlookup) James Morris
2005-05-12 0:12 ` Netfilter socket hooks Patrick McHardy
2005-04-27 6:04 ` [PATCH] owner-socketlookup update for 2.6.12-rc3 James Morris
2005-04-27 6:13 ` David S. Miller
2005-04-27 6:43 ` Patrick Schaaf [this message]
2005-04-27 6:55 ` Patrick Schaaf
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=20050427064304.GA5828@oknodo.bof.de \
--to=bof@bof.de \
--cc=davem@davemloft.net \
--cc=kaber@trash.net \
--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.