SOURCES (LINUX_2_6): wrr-linux-070717-2.6.22.patch - ported to nf
zbyniu
zbyniu at pld-linux.org
Mon Aug 13 03:45:37 CEST 2007
Author: zbyniu Date: Mon Aug 13 01:45:37 2007 GMT
Module: SOURCES Tag: LINUX_2_6
---- Log message:
- ported to nf
---- Files affected:
SOURCES:
wrr-linux-070717-2.6.22.patch (1.1.2.1 -> 1.1.2.2)
---- Diffs:
================================================================
Index: SOURCES/wrr-linux-070717-2.6.22.patch
diff -u SOURCES/wrr-linux-070717-2.6.22.patch:1.1.2.1 SOURCES/wrr-linux-070717-2.6.22.patch:1.1.2.2
--- SOURCES/wrr-linux-070717-2.6.22.patch:1.1.2.1 Mon Aug 13 03:44:09 2007
+++ SOURCES/wrr-linux-070717-2.6.22.patch Mon Aug 13 03:45:32 2007
@@ -235,18 +235,18 @@
obj-$(CONFIG_NET_SCHED) += sch_api.o sch_blackhole.o
obj-$(CONFIG_NET_CLS) += cls_api.o
-@@ -23,6 +24,7 @@
- obj-$(CONFIG_NET_SCH_INGRESS) += sch_ingress.o
- obj-$(CONFIG_NET_SCH_DSMARK) += sch_dsmark.o
- obj-$(CONFIG_NET_SCH_SFQ) += sch_sfq.o
-+obj-$(CONFIG_NET_SCH_WRR) += sch_wrr.o
+@@ -28,6 +29,7 @@
obj-$(CONFIG_NET_SCH_TBF) += sch_tbf.o
obj-$(CONFIG_NET_SCH_TEQL) += sch_teql.o
obj-$(CONFIG_NET_SCH_PRIO) += sch_prio.o
++obj-$(CONFIG_NET_SCH_WRR) += sch_wrr.o
+ obj-$(CONFIG_NET_SCH_ATM) += sch_atm.o
+ obj-$(CONFIG_NET_SCH_NETEM) += sch_netem.o
+ obj-$(CONFIG_NET_CLS_U32) += cls_u32.o
diff -urN linux-2.6.22.1.orig/net/sched/wrr.c linux-2.6.22.1/net/sched/wrr.c
--- linux-2.6.22.1.orig/net/sched/wrr.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.22.1/net/sched/wrr.c 2007-07-17 14:50:11.000000000 +0200
-@@ -0,0 +1,1385 @@
+@@ -0,0 +1,1387 @@
+/*-----------------------------------------------------------------------------
+Weighted Round Robin scheduler.
+
@@ -372,7 +372,9 @@
+#define ENQUEUE_FAIL NET_XMIT_DROP
+
+#if defined CONFIG_NF_CONNTRACK || defined CONFIG_NF_CONNTRACK_MODULE
-+#include <linux/netfilter_ipv4/ip_conntrack.h>
++#include <linux/netfilter/nf_conntrack_common.h>
++#include <linux/netfilter/nf_conntrack_tuple_common.h>
++#include <net/netfilter/nf_conntrack.h>
+#define MASQ_SUPPORT
+#endif
+
@@ -779,7 +781,7 @@
+ struct ethhdr *hdr;
+
+ /* This is the size of the network part of the packet */
-+ int size = ((char *)skb->data + skb->len) - ((char *)skb->nh.iph);
++ int size = ((char *)skb->data + skb->len) - ((char *)ip_hdr(skb));
+
+ /* Set a default value for the address */
+ memset(addr, 0, ETH_ALEN);
@@ -788,7 +790,7 @@
+ Everything (non-IPv4) else goes to a default address */
+ if (ntohs(skb->protocol) == ETH_P_IP) {
+
-+ struct iphdr *iph = skb->nh.iph; /* This is the IP header */
++ struct iphdr *iph = ip_hdr(skb); /* This is the IP header */
+
+ const __u16 *portp = (__u16 *) & (((char *)iph)[iph->ihl * 4]); /* Port numbers*/
+ __u16 sport = portp[0];
@@ -798,7 +800,7 @@
+ ProxyRemapBlock *prm; /* Proxyremapping */
+
+ /* IP packets must have valid checsum */
-+ if (!valid_ip_checksum(skb->nh.iph, size))
++ if (!valid_ip_checksum(ip_hdr(skb), size))
+ return -1;
+
+ /* Set ipaddr */
@@ -812,17 +814,17 @@
+ if (head->usemasq) {
+ /* Thanks to Rusty Russell for help with the following code */
+ enum ip_conntrack_info ctinfo;
-+ struct ip_conntrack *ct;
-+ ct = ip_conntrack_get(skb, &ctinfo);
++ struct nf_conn *ct;
++ ct = nf_ct_get(skb, &ctinfo);
+ if (ct) {
+ if (head->srcaddr)
+ ipaddr =
+ ct->tuplehash[CTINFO2DIR(ctinfo)].
-+ tuple.src.ip;
++ tuple.src.u3.ip;
+ else
+ ipaddr =
+ ct->tuplehash[CTINFO2DIR(ctinfo)].
-+ tuple.dst.ip;
++ tuple.dst.u3.ip;
+ }
+ }
+#endif
@@ -833,11 +835,11 @@
+ if (head->srcaddr) {
+ prm =
+ proxyLookup(head->proxyremap, ipaddr, sport,
-+ skb->nh.iph->protocol);
++ ip_hdr(skb)->protocol);
+ } else {
+ prm =
+ proxyLookup(head->proxyremap, ipaddr, dport,
-+ skb->nh.iph->protocol);
++ ip_hdr(skb)->protocol);
+ }
+ }
+ /* And finally set the correct address */
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SOURCES/wrr-linux-070717-2.6.22.patch?r1=1.1.2.1&r2=1.1.2.2&f=u
More information about the pld-cvs-commit
mailing list