Update of /cvsroot/leaf/src/bering-uclibc/apps/linux/patches
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7848

Added Files:
        ppp-multilink.patch 
Log Message:
ppp multilink support
patch provided by Pierre G. Martineau



--- NEW FILE: ppp-multilink.patch ---
--- linux-2.4.34.6.orig/net/ipv4/netfilter/ip_conntrack_core.c  2008-10-22 
12:47:22.000000000 -0400
+++ linux-2.4.34.6/net/ipv4/netfilter/ip_conntrack_core.c       2008-10-20 
12:22:36.000000000 -0400
@@ -746,7 +746,7 @@
                __set_bit(IPS_EXPECTED_BIT, &conntrack->status);
                conntrack->master = expected;
                expected->sibling = conntrack;
-#if CONFIG_IP_NF_CONNTRACK_MARK
+#if defined(CONFIG_IP_NF_CONNTRACK_MARK)
                conntrack->mark = expected->expectant->mark;
 #endif
                LIST_DELETE(&ip_conntrack_expect_list, expected);
--- linux-2.4.34.6.orig/net/ipv4/netfilter/ipt_MARK.c   2007-07-22 
09:50:47.000000000 -0400
+++ linux-2.4.34.6/net/ipv4/netfilter/ipt_MARK.c        2008-10-22 
12:59:55.000000000 -0400
@@ -9,41 +9,67 @@

 static unsigned int
 target(struct sk_buff **pskb,
-       unsigned int hooknum,
-       const struct net_device *in,
-       const struct net_device *out,
-       const void *targinfo,
-       void *userinfo)
+       unsigned int hooknum,
+       const struct net_device *in,
+       const struct net_device *out,
+       const void *targinfo,
+       void *userinfo)
 {
        const struct ipt_mark_target_info *markinfo = targinfo;
+       int mark = 0;

-       if((*pskb)->nfmark != markinfo->mark) {
-               (*pskb)->nfmark = markinfo->mark;
+       switch (markinfo->mode) {
+       case IPT_MARK_SET:
+               mark = markinfo->mark;
+               break;
+
+       case IPT_MARK_AND:
+               mark = (*pskb)->nfmark & markinfo->mark;
+               break;
+
+       case IPT_MARK_OR:
+               mark = (*pskb)->nfmark | markinfo->mark;
+               break;
+       }
+
+       if((*pskb)->nfmark != mark) {
+               (*pskb)->nfmark = mark;
                (*pskb)->nfcache |= NFC_ALTERED;
        }
        return IPT_CONTINUE;
 }

+
 static int
 checkentry(const char *tablename,
-          const struct ipt_entry *e,
-           void *targinfo,
-           unsigned int targinfosize,
-           unsigned int hook_mask)
+            const struct ipt_entry *e,
+            void *targinfo,
+            unsigned int targinfosize,
+            unsigned int hook_mask)
 {
-       if (targinfosize != IPT_ALIGN(sizeof(struct ipt_mark_target_info))) {
-               printk(KERN_WARNING "MARK: targinfosize %u != %Zu\n",
-                      targinfosize,
-                      IPT_ALIGN(sizeof(struct ipt_mark_target_info)));
-               return 0;
-       }
+      struct ipt_mark_target_info *markinfo = targinfo;

-       if (strcmp(tablename, "mangle") != 0) {
-               printk(KERN_WARNING "MARK: can only be called from \"mangle\" 
table, not \"%s\"\n", tablename);
-               return 0;
-       }
+      if (targinfosize != IPT_ALIGN(sizeof(struct ipt_mark_target_info))){
+              printk(KERN_WARNING "MARK: targinfosize %u != %Zu\n",
+                     targinfosize,
+                     IPT_ALIGN(sizeof(struct ipt_mark_target_info)));
+              return 0;
+      }
+
+      if (strcmp(tablename, "mangle") != 0) {
+              printk(KERN_WARNING "MARK: can only be called from \"mangle\" 
table, not \"%s\"\n", tablename);
+              return 0;
+      }
+
+      if (markinfo->mode != IPT_MARK_SET
+          && markinfo->mode != IPT_MARK_AND
+          && markinfo->mode != IPT_MARK_OR) {
+              printk(KERN_WARNING "MARK: unknown mode %u\n",
+                     markinfo->mode);
+              return 0;
+      }

-       return 1;
+      return 1;
 }

 static struct ipt_target ipt_mark_reg
@@ -51,10 +77,10 @@

 static int __init init(void)
 {
-       if (ipt_register_target(&ipt_mark_reg))
-               return -EINVAL;
+      int err;

-       return 0;
+      err = ipt_register_target(&ipt_mark_reg);
+      return err;
 }

 static void __exit fini(void)
--- linux-2.4.34.6.orig/include/linux/netfilter_ipv4/ipt_MARK.h 2007-07-22 
09:50:47.000000000 -0400
+++ linux-2.4.34.6/include/linux/netfilter_ipv4/ipt_MARK.h      2008-10-22 
15:44:35.000000000 -0400
@@ -3,6 +3,13 @@

 struct ipt_mark_target_info {
        unsigned long mark;
+       u_int8_t mode;
+};
+
+enum {
+       IPT_MARK_SET=0,
+       IPT_MARK_AND,
+       IPT_MARK_OR
 };

 #endif /*_IPT_MARK_H_target*/


------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
leaf-cvs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/leaf-cvs-commits

Reply via email to