Skip to contentSkip to conversation

OSF: netlink related changes.

PATCH In review Evgeniy Polyakov 2 participants 3 messages Dec 9, 2005 – Dec 12, 2005 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OSF: netlink related changes.

Hello, developers.
Due to new interface and changed API in netlink area several patch-o-matic modules can not be compiled. Passive OS fingerprinting OSF modules is one of them. Consider for inclusion.

This patch has been done against just downloaded ipt_osf.c file from cvs.netfilter.org.
I only read list archive and did not receive your feedback, sorry for not answering.

patch-o-matic-ng/patchlets/osf/linux-2.6/net/ipv4/netfilter/ipt_osf.c 2005-11-05 12:43:54.000000000 -0500 renamed from patch-o-matic-ng/patchlets/osf/linux-2.6/net/ipv4/netfilter/ipt_osf.c 2005-11-05 12:35:02.000000000 -0500 +9 -0
@@ -30,6 +30,7 @@
 
 #include <linux/config.h>
 #include <linux/kernel.h>
+#include <linux/version.h>
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/smp.h>
@@ -155,7 +156,11 @@
 	memcpy(&data->ip, sk->nh.iph, sizeof(struct iphdr));
 	memcpy(&data->tcp, (struct tcphdr *)((u_int32_t *)sk->nh.iph + sk->nh.iph->ihl), sizeof(struct tcphdr));
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
 	NETLINK_CB(skb).dst_groups = ipt_osf_groups;
+#else
+	NETLINK_CB(skb).dst_group = ipt_osf_groups;
+#endif
 	netlink_broadcast(nts, skb, 0, ipt_osf_groups, GFP_ATOMIC);
 
 nlmsg_failure:
@@ -821,7 +826,11 @@
 	p->write_proc->osf_proc_write;
 	p->read_proc->osf_proc_read;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
 	nts->netlink_kernel_create(NETLINK_NFLOG, NULL);
+#else
+	nts->netlink_kernel_create(NETLINK_NFLOG, 1, NULL, THIS_MODULE);
+#endif
 	if (!nts) {
 		log("netlink_kernel_create() failed\n");
 	}
Signature · 1 line
	Evgeniy Polyakov
#1 lore raw
Quoted 4 lines · Evgeniy Polyakov

This patch has been done against just downloaded ipt_osf.c file from cvs.netfilter.org.
I only read list archive and did not receive your feedback, sorry for not answering.

Well it still didn't apply. I finally fixed it up manually, but the reason is that there is no such line "nts->netlink_kernel_create" in SVN, and I don't see how this ever could have compiled, since nts is a struct sock, which doesn't have a netlink_kernel_create member. I also noticed that you're reusing NETLINK_NFLOG. You can't do that. We can reserve a nfnetlink group if you need.

Quoted 10 lines
patch-o-matic-ng/patchlets/osf/linux-2.6/net/ipv4/netfilter/ipt_osf.c 2005-11-05 12:43:54.000000000 -0500 renamed from patch-o-matic-ng/patchlets/osf/linux-2.6/net/ipv4/netfilter/ipt_osf.c 2005-11-05 12:35:02.000000000 -0500 +4 -0
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
 	nts->netlink_kernel_create(NETLINK_NFLOG, NULL);
+#else
+	nts->netlink_kernel_create(NETLINK_NFLOG, 1, NULL, THIS_MODULE);
+#endif
 	if (!nts) {
 		log("netlink_kernel_create() failed\n");
 	}
#2 lore raw
In reply to Evgeniy Polyakov

patch-o-matic-ng/patchlets/osf/linux-2.6/net/ipv4/netfilter/ipt_osf.c 2005-11-05 12:43:54.000000000 -0500 line 833

Quoted 5 lines
patch-o-matic-ng/patchlets/osf/linux-2.6/net/ipv4/netfilter/ipt_osf.c 2005-11-05 12:43:54.000000000 -0500 renamed from patch-o-matic-ng/patchlets/osf/linux-2.6/net/ipv4/netfilter/ipt_osf.c 2005-11-05 12:35:02.000000000 -0500 +4 -0
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
 	nts->netlink_kernel_create(NETLINK_NFLOG, NULL);
+#else
+	nts->netlink_kernel_create(NETLINK_NFLOG, 1, NULL, THIS_MODULE);
+#endif

Crap.
It's totally my fault: MIME type was decoded incorrectly - "=" replaced with "->" when I downloaded this file.

Thanks, Patrik, for resolving this.

Signature · 1 line
	Evgeniy Polyakov