IPMARK nfcache
Hi
Recently went to path IPMARK (Patchlet from patch o matic) to a 2.6.14 source tree and I have noticed this compilation error
net/ipv4/netfilter/ipt_IPMARK.c: In function 'target':net/ipv4/netfilter/ipt_IPMARK.c:36: error: 'struct sk_buff' has no member named 'nfcache'net/ipv4/netfilter/ipt_IPMARK.c:36: error: 'NFC_ALTERED' undeclared (first use in this function) net/ipv4/netfilter/ipt_IPMARK.c:36: error: (Each undeclared identifier is reported only oncenet/ipv4/netfilter/ipt_IPMARK.c:36: error: for each function it appears in.)
on investigation the nfcache field from sk_buff has been removed, having a look on the net as to why
I was wondering what mechanism is need to replace the 'ncfcache | NFC_ALTERED' statement
Seem like it has been killed - gives me the impression I can remove this line with no bad side effects ?
commit 6869c4d8e066e21623c812c448a05f1ed931c9c6
Author: Harald Welte <[email protected]> Date: Tue Aug 9 19:24:19 2005 -0700
[NETFILTER]: reduce netfilter sk_buff enlargement
As discussed at netconf'05, we're trying to save every bit insk_buff.
The patch below makes sk_buff 8 bytes smaller. I did some basic testing on my notebook and it seems to work.
The only real in-tree user of nfcache was IPVS, who only needs a single bit. Unfortunately I couldn't find some other free bit in sk_buff to stuff that bit into, so I introduced a separate field for them. Maybe the IPVS guys can resolve that to further save space.
Initially I wanted to shrink pkt_type to three bits (PACKET_HOST and alike are only 6 values defined), but unfortunately the bluetooth
code
overloads pkt_type :(
The conntrack-event-api (out-of-tree) uses nfcache, but Rusty just came up with a way how to do it without any skb fields, so it's safe to remove it.
- remove all never-implemented 'nfcache' code
- don't have ipvs code abuse 'nfcache' field. currently get's their own
compile-conditional skb->ipvs_property field. IPVS maintainers
can
decide to move this bit elswhere, but nfcache needs to die.
- remove skb->nfcache field to save 4 bytes
- move skb->nfctinfo into three unused bits to save further 4 bytes
Thanks
Alex
Quoted 11 lines · Alexander Samad
Recently went to path IPMARK (Patchlet from patch o matic) to a 2.6.14 source tree and I have noticed this compilation error
net/ipv4/netfilter/ipt_IPMARK.c: In function 'target':net/ipv4/netfilter/ipt_IPMARK.c:36: error: 'structsk_buff' has no member named 'nfcache'net/ipv4/netfilter/ipt_IPMARK.c:36: error: 'NFC_ALTERED' undeclared (first use in this function)
on investigation the nfcache field fromsk_buffhas been removed, having a look on the net as to why
I was wondering what mechanism is need to replace the 'ncfcache |NFC_ALTERED' statement
My IPMARK was based on original MARK target. You can look what has changed in libipt_MARK.c and correct it.
I don't know if I have to submit a new patch or it will be corrected by netfilter developers?
Signature · 1 line
Grzegorz Janoszka
Quoted 1 line · Grzegorz Janoszka
My IPMARK was based on original MARK target. You can look what has changed in
libipt_MARK.cand correct it.
http://patchwork.netfilter.org/netfilter-devel/patch.pl?id=2689
The patch dedicated to net/ipv4/netfilter/ipt_MARK.c should go to ipt_IPMARK.c
Quoted 1 line
I don't know if I have to submit a new patch or it will be corrected by netfilter developers?
I suggest you make the changes, can you do it?
Signature · 1 line
Grzegorz Janoszka
Quoted 7 lines · Grzegorz Janoszka
Quoted 2 lines · Grzegorz Janoszka
My IPMARK was based on original MARK target. You can look what has changed in
libipt_MARK.cand correct it.http://patchwork.netfilter.org/netfilter-devel/patch.pl?id=2689
Quoted 7 lines
The patch dedicated to
net/ipv4/netfilter/ipt_MARK.cshould go toipt_IPMARK.cQuoted 2 lines
I don't know if I have to submit a new patch or it will be corrected by netfilter developers?
I suggest you make the changes, can you do it?
Cool, will give it a go!
Quoted 4 lines
Signature · 2 lines
-- Grzegorz Janoszka