All of lore.kernel.org
 help / color / mirror / Atom feed
* [1/1] OSF: pom-ng - linux-2.6.
@ 2004-12-08 10:58 Evgeniy Polyakov
  2004-12-08 11:02 ` Evgeniy Polyakov
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Evgeniy Polyakov @ 2004-12-08 10:58 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Harald Welte, Patrick McHardy


[-- Attachment #1.1: Type: text/plain, Size: 323 bytes --]

Since OSF originally was created in 2.5 environment 
it is strange not to have 2.6 support for OSF.
This(similar) patch was sent some time ago but was lost.
Please apply.

Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
-- 
        Evgeniy Polyakov

Crash is better than data corruption -- Arthur Grabowski

[-- Attachment #1.2: ipt_osf --]
[-- Type: text/plain, Size: 2790 bytes --]

--- /tmp/osf/ipt_osf.c	2004-12-08 13:39:02.621927128 +0300
+++ /home/s0mbre/aWork/tmp/osf/ipt_osf.c	2004-08-25 09:02:25.000000000 +0400
@@ -52,14 +52,15 @@
 
 #include "ipt_osf.h"
 
-#define OSF_DEBUG
+//#define OSF_DEBUG
+#undef OSF_DEBUG
 
 #ifdef OSF_DEBUG
 #define log(x...) 		printk(KERN_INFO "ipt_osf: " x)
 #define loga(x...) 		printk(x)
 #else
-#define log(x...) 		do {} while(0)
-#define loga(x...) 		do {} while(0)
+#define log(x...)
+#define loga(x...)
 #endif
 
 #define FMATCH_WRONG		0
@@ -76,7 +77,7 @@
 static struct list_head	finger_list;	
 static int match(const struct sk_buff *, const struct net_device *, const struct net_device *,
 		      const void *, int, 
-		      const void *, u_int16_t, 
+		      //const void *, u_int16_t, 
 		      int *);
 static int checkentry(const char *, const struct ipt_ip *, void *,
 		           unsigned int, unsigned int);
@@ -153,7 +154,7 @@
 static int
 match(const struct sk_buff *skb, const struct net_device *in, const struct net_device *out,
       const void *matchinfo, int offset,
-      const void *hdr, u_int16_t datalen,
+      //const void *hdr, u_int16_t datalen,
       int *hotdrop)
 {
 	struct ipt_osf_info *info = (struct ipt_osf_info *)matchinfo;
@@ -184,7 +185,6 @@
 		optsize = tcp->doff*4 - sizeof(struct tcphdr);
 	}
 
-	
 	/* Actually we can create hash/table of all genres and search
 	 * only in appropriate part, but here is initial variant,
 	 * so will use slow path.
@@ -414,7 +414,10 @@
 	}
 
 	read_unlock(&osf_lock);
-
+	
+	if (fcount)
+		fmatch = FMATCH_OK;
+	
 	return (fmatch == FMATCH_OK)?1:0;
 }
 
@@ -600,9 +603,10 @@
 {
 	struct list_head *ent;
 	struct osf_finger *f = NULL;
-	int i;
+	int i, __count, err;
 	
 	*eof = 1;
+	__count = count;
 	count = 0;
 
 	read_lock_bh(&osf_lock);
@@ -612,10 +616,13 @@
 
 		log("%s [%s]", f->genre, f->details);
 		
-		count += sprintf(buf+count, "%s - %s[%s] : %s", 
+		err = snprintf(buf+count, __count-count, "%s - %s[%s] : %s", 
 					f->genre, f->version,
 					f->subtype, f->details);
-		
+		if (err == 0 || __count <= count + err)
+			break;
+		else
+			count += err;
 		if (f->opt_num)
 		{
 			loga(" OPT: ");
@@ -629,7 +636,11 @@
 			}
 		}
 		loga("\n");
-		count += sprintf(buf+count, "\n");
+		err = snprintf(buf+count, __count-count, "\n");
+		if (err == 0 || __count <= count + err)
+			break;
+		else
+			count += err;
 	}
 	read_unlock_bh(&osf_lock);
 
@@ -844,8 +855,8 @@
 	
 	remove_proc_entry("sys/net/ipv4/osf", NULL);
 	ipt_unregister_match(&osf_match);
-	if (nts && nts->socket)
-		sock_release(nts->socket);
+	if (nts && nts->sk_socket)
+		sock_release(nts->sk_socket);
 
 	list_for_each_safe(ent, n, &finger_list)
 	{

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2005-01-02 23:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-08 10:58 [1/1] OSF: pom-ng - linux-2.6 Evgeniy Polyakov
2004-12-08 11:02 ` Evgeniy Polyakov
2004-12-08 18:48   ` Patrick McHardy
2004-12-12 15:13     ` Evgeniy Polyakov
2005-01-02 23:31       ` Patrick McHardy
2004-12-08 13:32 ` Pavel A. Nekrasov
2004-12-08 13:43   ` Evgeniy Polyakov
2004-12-08 18:44 ` Patrick McHardy

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.