From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: netfilter-devel@lists.netfilter.org
Cc: Harald Welte <laforge@netfilter.org>, Patrick McHardy <kaber@trash.net>
Subject: [1/1] OSF: pom-ng - linux-2.6.
Date: Wed, 08 Dec 2004 13:58:53 +0300 [thread overview]
Message-ID: <1102503533.3363.48.camel@uganda> (raw)
[-- 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 --]
next reply other threads:[~2004-12-08 10:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-08 10:58 Evgeniy Polyakov [this message]
2004-12-08 11:02 ` [1/1] OSF: pom-ng - linux-2.6 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1102503533.3363.48.camel@uganda \
--to=johnpol@2ka.mipt.ru \
--cc=kaber@trash.net \
--cc=laforge@netfilter.org \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.