* [PATCH][CTNETLINK] Include the id in conntrack netlink events. @ 2007-08-14 5:07 Philip Craig 2007-08-14 6:01 ` Patrick McHardy 0 siblings, 1 reply; 4+ messages in thread From: Philip Craig @ 2007-08-14 5:07 UTC (permalink / raw) To: Netfilter Developer Mailing List [-- Attachment #1: Type: text/plain, Size: 126 bytes --] I need the id in ctnetlink events for my application, so here's a patch to add it in case this wasn't left out intentionally. [-- Attachment #2: ctnl-event-id.patch --] [-- Type: text/x-diff, Size: 576 bytes --] Include the id in conntrack netlink events. Signed-off-by: Philip Craig <philipc@snapgear.com> --- linux-2.6.x/net/netfilter/nf_conntrack_netlink.c 9 Jul 2007 04:54:43 -0000 +++ linux-2.6.x/net/netfilter/nf_conntrack_netlink.c 14 Aug 2007 04:51:22 -0000 @@ -362,6 +362,9 @@ static int ctnetlink_conntrack_event(str nfmsg->version = NFNETLINK_V0; nfmsg->res_id = 0; + if (ctnetlink_dump_id(skb, ct) < 0) + goto nfattr_failure; + nest_parms = NFA_NEST(skb, CTA_TUPLE_ORIG); if (ctnetlink_dump_tuples(skb, tuple(ct, IP_CT_DIR_ORIGINAL)) < 0) goto nfattr_failure; ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][CTNETLINK] Include the id in conntrack netlink events. 2007-08-14 5:07 [PATCH][CTNETLINK] Include the id in conntrack netlink events Philip Craig @ 2007-08-14 6:01 ` Patrick McHardy [not found] ` <46C14B05.2000200@snapgear.com> 0 siblings, 1 reply; 4+ messages in thread From: Patrick McHardy @ 2007-08-14 6:01 UTC (permalink / raw) To: Philip Craig; +Cc: Netfilter Developer Mailing List Philip Craig wrote: > I need the id in ctnetlink events for my application, so here's a > patch to add it in case this wasn't left out intentionally. > It was, we have plans to remove it. What for do you need it exactly? ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <46C14B05.2000200@snapgear.com>]
* Re: [PATCH][CTNETLINK] Include the id in conntrack netlink events. [not found] ` <46C14B05.2000200@snapgear.com> @ 2007-08-14 6:34 ` Patrick McHardy 2007-08-14 7:03 ` Philip Craig 0 siblings, 1 reply; 4+ messages in thread From: Patrick McHardy @ 2007-08-14 6:34 UTC (permalink / raw) To: Philip Craig; +Cc: Netfilter Developer Mailing List Philip Craig wrote: > Patrick McHardy wrote: > >> Philip Craig wrote: >> >>> I need the id in ctnetlink events for my application, so here's a >>> patch to add it in case this wasn't left out intentionally. >>> >> It was, we have plans to remove it. What for do you need it >> exactly? > > So it won't be needed for dumping either? No, I removed that in 2.6.23-rc. > > It's just a simple way of matching up events, so that I can log both > start and finish time, as well as the other details. > > The alternative is to cache the tuples in userspace and match on them, > but that is significantly more complicated. And caching requires > more memory usage than having an id in the kernel. > True, but its quite a waste in the kernel as well when considering that almost nobody needs this. I was thinking about derriving a unique ID just for userspace from the conntrack address (in memory). Its not unique over time, just as tuples aren't, but when combined with the tuples it should only clash very rarely, and you'll always get a DESTROY + NEW event before a clash. Would that work for you? ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][CTNETLINK] Include the id in conntrack netlink events. 2007-08-14 6:34 ` Patrick McHardy @ 2007-08-14 7:03 ` Philip Craig 0 siblings, 0 replies; 4+ messages in thread From: Philip Craig @ 2007-08-14 7:03 UTC (permalink / raw) To: Patrick McHardy; +Cc: Netfilter Developer Mailing List Patrick McHardy wrote: > True, but its quite a waste in the kernel as well when considering > that almost nobody needs this. I was thinking about derriving a > unique ID just for userspace from the conntrack address (in memory). > Its not unique over time, just as tuples aren't, but when combined > with the tuples it should only clash very rarely, and you'll always > get a DESTROY + NEW event before a clash. Would that work for you? Yes, that should be fine. I've used that previously with an old linux 2.4 conntrack events patch. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-08-14 7:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-14 5:07 [PATCH][CTNETLINK] Include the id in conntrack netlink events Philip Craig
2007-08-14 6:01 ` Patrick McHardy
[not found] ` <46C14B05.2000200@snapgear.com>
2007-08-14 6:34 ` Patrick McHardy
2007-08-14 7:03 ` Philip Craig
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.