Skip to contentSkip to conversation

target_info read only?

DISCUSSION Thomas Heinz 2 participants 2 messages Jan 20, 2003 – Jan 21, 2003 netfilter

lore
Share & tools
lore
#0 lore raw

Hi

A netfilter target (struct ipt_entry_target) can contain an arbitrary amount of private data which is delivered to the target function in case the corresponding rule matches.

Now it would be possible for the target function to modify the private data although I haven't seen any target that does this. In contrast to targets this behaviour is quite normal for matches, especially stateful ones.

Now, I have two questions:

1) Is there any target (kernel and cvs) that already modifies its private data (maybe I have overlooked one)?

2) If ! 1) is there any reason for which targets might want to write to their private data buffer and if not can I assume that netfilter targets must (sort of unwritten law like) treat their private data as read only?

Thanks for your answer.

Regards,

Thomas

#1 lore raw
Quoted 5 lines · Thomas Heinz

Hi

A netfilter target (struct ipt_entry_target) can contain an arbitrary amount of private data which is delivered to the target function in case the corresponding rule matches.

true.

Quoted 4 lines

Now it would be possible for the target function to modify the private data although I haven't seen any target that does this. In contrast to targets this behaviour is quite normal for matches, especially stateful ones.

true.

Quoted 2 lines

1) Is there any target (kernel and cvs) that already modifies its private data (maybe I have overlooked one)?

Not that I am aware of.... You might want to look for the PSD target (yes, it was a target before it became a match). This was years ago.

Quoted 4 lines

2) If ! 1) is there any reason for which targets might want to write to their private data buffer and if not can I assume that netfilter targets must (sort of unwritten law like) treat their private data as read only?

no. they can. But please note that (like matchinfo) you are operating on per-cpu local data. So in an SMP system, there will be one targinfo per cpu.

Quoted 2 lines

Regards,
Thomas

Signature · 4 lines
- Harald Welte / [email protected]               http://www.gnumonks.org/
============================================================================
"If this were a dictatorship, it'd be a heck of a lot easier, just so long
 as I'm the dictator."  --  George W. Bush Dec 18, 2000