All of lore.kernel.org
 help / color / mirror / Atom feed
* adding data fields to netfilter_conntrack / conntrack events
@ 2006-08-22 22:41 Stuart Zilm
  2006-08-23 12:47 ` Jarek Poplawski
  0 siblings, 1 reply; 4+ messages in thread
From: Stuart Zilm @ 2006-08-22 22:41 UTC (permalink / raw)
  To: netfilter-devel

I'm trying to add some more data to that which gets passed across the  
netlink socket for conntrack events, but can't seem to get the data  
from the kernel to arrive in userspace.

I've added the following to net/ipv4/netfilter/ip_conntrack_netlink.c:

static inline int
ctnetlink_dump_foo(struct sk_buff *skb, const struct ip_conntrack *ct)
{
	char dummy[sizeof(struct timeval)] = {0xde, 0xad, 0xde, 0xad, 0xde,  
0xad, 0xde, 0xad};

	NFA_PUT(skb, CTA_FOO, sizeof(struct timeval), dummy);
	
	return 0;

nfattr_failure:
         printk("<6>ctnetlink_dump_foo: nfattr_failure\n");
         return -1;
}

// note that CTA_FOO = 13

and ensured it is called within ctnetlink_conntrack_event(...).  A  
raw dump of the skb to be send over the netlink socket confirms the  
magic number at the end of the packet.

However, on the userspace side (conntrack-1.00beta1,  
libnetfilter_conntrack-0.0.30, libnfnetlink-0.0.14), the data does  
not seem to arrive correctly.  Calling nfnl_dump_packet(...) on the  
nlmsghdr within nfnl_listen(...) in libnfnetlink.c indicates that the  
payload should contain the data:
...
nfa@0xbfdfa9c4: nfa_type=13, nfa_len=12
...

but there are only zeroes where the magic number should be!

Can anyone help me to understand why this data is not traversing the  
netlink socket intact from kernel space to user space?
Thank you for any assistance,

Stuart Zilm
PresiNET Systems

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-08-24 10:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-22 22:41 adding data fields to netfilter_conntrack / conntrack events Stuart Zilm
2006-08-23 12:47 ` Jarek Poplawski
2006-08-23 23:39   ` Stuart Zilm
2006-08-24 10:34     ` Jarek Poplawski

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.