[SK_BUFF]: Introduce ip_hdr(), remove skb->nh.iph
[pandora-kernel.git] / net / ipv4 / ipvs / ip_vs_lblc.c
index 524751e..052f4ed 100644 (file)
@@ -45,6 +45,7 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/skbuff.h>
+#include <linux/jiffies.h>
 
 /* for sysctl */
 #include <linux/fs.h>
@@ -117,7 +118,7 @@ static ctl_table vs_vars_table[] = {
                .procname       = "lblc_expiration",
                .data           = &sysctl_ip_vs_lblc_expiration,
                .maxlen         = sizeof(int),
-               .mode           = 0644, 
+               .mode           = 0644,
                .proc_handler   = &proc_dointvec_jiffies,
        },
        { .ctl_name = 0 }
@@ -127,7 +128,7 @@ static ctl_table vs_table[] = {
        {
                .ctl_name       = NET_IPV4_VS,
                .procname       = "vs",
-               .mode           = 0555, 
+               .mode           = 0555,
                .child          = vs_vars_table
        },
        { .ctl_name = 0 }
@@ -136,7 +137,7 @@ static ctl_table vs_table[] = {
 static ctl_table ipvs_ipv4_table[] = {
        {
                .ctl_name       = NET_IPV4,
-               .procname       = "ipv4", 
+               .procname       = "ipv4",
                .mode           = 0555,
                .child          = vs_table
        },
@@ -146,8 +147,8 @@ static ctl_table ipvs_ipv4_table[] = {
 static ctl_table lblc_root_table[] = {
        {
                .ctl_name       = CTL_NET,
-               .procname       = "net", 
-               .mode           = 0555, 
+               .procname       = "net",
+               .mode           = 0555,
                .child          = ipvs_ipv4_table
        },
        { .ctl_name = 0 }
@@ -287,7 +288,7 @@ static inline void ip_vs_lblc_full_check(struct ip_vs_lblc_table *tbl)
 
                write_lock(&tbl->lock);
                list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) {
-                       if (time_before(now, 
+                       if (time_before(now,
                                        en->lastuse + sysctl_ip_vs_lblc_expiration))
                                continue;
 
@@ -520,7 +521,7 @@ ip_vs_lblc_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
        struct ip_vs_dest *dest;
        struct ip_vs_lblc_table *tbl;
        struct ip_vs_lblc_entry *en;
-       struct iphdr *iph = skb->nh.iph;
+       struct iphdr *iph = ip_hdr(skb);
 
        IP_VS_DBG(6, "ip_vs_lblc_schedule(): Scheduling...\n");
 
@@ -582,7 +583,7 @@ static struct ip_vs_scheduler ip_vs_lblc_scheduler =
 static int __init ip_vs_lblc_init(void)
 {
        INIT_LIST_HEAD(&ip_vs_lblc_scheduler.n_list);
-       sysctl_header = register_sysctl_table(lblc_root_table, 0);
+       sysctl_header = register_sysctl_table(lblc_root_table);
        return register_ip_vs_scheduler(&ip_vs_lblc_scheduler);
 }