Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: iptables: Devel

[PATCH][CTNETLINK] Include the id in conntrack netlink events.

 

 

iptables devel RSS feed   Index | Next | Previous | View Threaded


philipc at snapgear

Aug 13, 2007, 10:07 PM

Post #1 of 5 (951 views)
Permalink
[PATCH][CTNETLINK] Include the id in conntrack netlink events.

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.
Attachments: ctnl-event-id.patch (0.56 KB)


kaber at trash

Aug 13, 2007, 11:01 PM

Post #2 of 5 (894 views)
Permalink
Re: [PATCH][CTNETLINK] Include the id in conntrack netlink events. [In reply to]

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?


philipc at snapgear

Aug 13, 2007, 11:26 PM

Post #3 of 5 (893 views)
Permalink
Re: [PATCH][CTNETLINK] Include the id in conntrack netlink events. [In reply to]

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?

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.


kaber at trash

Aug 13, 2007, 11:34 PM

Post #4 of 5 (891 views)
Permalink
Re: [PATCH][CTNETLINK] Include the id in conntrack netlink events. [In reply to]

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?


philipc at snapgear

Aug 14, 2007, 12:03 AM

Post #5 of 5 (895 views)
Permalink
Re: [PATCH][CTNETLINK] Include the id in conntrack netlink events. [In reply to]

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.

iptables devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.