Skip to contentSkip to conversation

CONNMARK target without ip_conntrack

DISCUSSION Piotr Chytla 2 participants 2 messages Oct 18, 2005 netfilter

lore
Share & tools
lore
#0 lore raw

Hi

Today one of my friends told me about very simple problem with CONNMARK , after loading it without ip_conntrack, everything is ok but marking isn't working .

In ipt_CONNMARK.c I've found in function target :

[..]
static unsigned int
target(struct sk_buff **pskb,
const struct net_device *in,
const struct net_device *out,
unsigned int hooknum,
const void *targinfo,
void *userinfo)
{
[..]

        enum ip_conntrack_info ctinfo;
        struct ip_conntrack *ct = ip_conntrack_get((*pskb), &ctinfo);
        if (ct) {
		[..] - set/save/restore mark
	} 

[..]

Mark set/restore/save is set when ip_conntrack structure exist , but there is no warning message in logs about not loaded ip_conntrack or something similar. Maybe it's wise to put some warning message :

if (ct) {
	[..]
} else printk(KERN_ERR "CONNMARK: no conntrack!\n");

/pch

Signature · 2 lines
Dyslexia bug unpatched since 1977 ...
exploit has been leaked to the underground.
#1 lore raw
Quoted 7 lines · Piotr Chytla

Mark set/restore/save is set when ip_conntrack structure exist , but there is no warning message in logs about not loaded ip_conntrack or something similar. Maybe it's wise to put some warning message :

if (ct) {
	[..]
} else printk(KERN_ERR "CONNMARK: no conntrack!\n");

No. Even with ip_conntrack loaded it could possible that a skb doesn't have any conntrack associated: in that case it means that the packet is considered invalid.

--
Pablo