[PATCH] x86-64: Don't include config.h in asm/timex.h
[pandora-kernel.git] / net / core / neighbour.c
index 0fb742e..39fc55e 100644 (file)
@@ -32,6 +32,7 @@
 #include <net/sock.h>
 #include <linux/rtnetlink.h>
 #include <linux/random.h>
+#include <linux/string.h>
 
 #define NEIGH_DEBUG 1
 
@@ -1216,7 +1217,7 @@ static void neigh_proxy_process(unsigned long arg)
 
        while (skb != (struct sk_buff *)&tbl->proxy_queue) {
                struct sk_buff *back = skb;
-               long tdif = back->stamp.tv_usec - now;
+               long tdif = NEIGH_CB(back)->sched_next - now;
 
                skb = skb->next;
                if (tdif <= 0) {
@@ -1247,8 +1248,9 @@ void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p,
                kfree_skb(skb);
                return;
        }
-       skb->stamp.tv_sec  = LOCALLY_ENQUEUED;
-       skb->stamp.tv_usec = sched_next;
+
+       NEIGH_CB(skb)->sched_next = sched_next;
+       NEIGH_CB(skb)->flags |= LOCALLY_ENQUEUED;
 
        spin_lock(&tbl->proxy_queue.lock);
        if (del_timer(&tbl->proxy_timer)) {
@@ -1597,6 +1599,8 @@ static int neightbl_fill_info(struct neigh_table *tbl, struct sk_buff *skb,
 
        read_lock_bh(&tbl->lock);
        ndtmsg->ndtm_family = tbl->family;
+       ndtmsg->ndtm_pad1   = 0;
+       ndtmsg->ndtm_pad2   = 0;
 
        RTA_PUT_STRING(skb, NDTA_NAME, tbl->id);
        RTA_PUT_MSECS(skb, NDTA_GC_INTERVAL, tbl->gc_interval);
@@ -1682,6 +1686,8 @@ static int neightbl_fill_param_info(struct neigh_table *tbl,
 
        read_lock_bh(&tbl->lock);
        ndtmsg->ndtm_family = tbl->family;
+       ndtmsg->ndtm_pad1   = 0;
+       ndtmsg->ndtm_pad2   = 0;
        RTA_PUT_STRING(skb, NDTA_NAME, tbl->id);
 
        if (neightbl_fill_parms(skb, parms) < 0)
@@ -1859,19 +1865,20 @@ out:
 }
 
 static int neigh_fill_info(struct sk_buff *skb, struct neighbour *n,
-                          u32 pid, u32 seq, int event)
+                          u32 pid, u32 seq, int event, unsigned int flags)
 {
        unsigned long now = jiffies;
        unsigned char *b = skb->tail;
        struct nda_cacheinfo ci;
        int locked = 0;
        u32 probes;
-       struct nlmsghdr *nlh = NLMSG_PUT(skb, pid, seq, event,
-                                        sizeof(struct ndmsg));
+       struct nlmsghdr *nlh = NLMSG_NEW(skb, pid, seq, event,
+                                        sizeof(struct ndmsg), flags);
        struct ndmsg *ndm = NLMSG_DATA(nlh);
 
-       nlh->nlmsg_flags = pid ? NLM_F_MULTI : 0;
        ndm->ndm_family  = n->ops->family;
+       ndm->ndm_pad1    = 0;
+       ndm->ndm_pad2    = 0;
        ndm->ndm_flags   = n->flags;
        ndm->ndm_type    = n->type;
        ndm->ndm_ifindex = n->dev->ifindex;
@@ -1920,7 +1927,8 @@ static int neigh_dump_table(struct neigh_table *tbl, struct sk_buff *skb,
                                continue;
                        if (neigh_fill_info(skb, n, NETLINK_CB(cb->skb).pid,
                                            cb->nlh->nlmsg_seq,
-                                           RTM_NEWNEIGH) <= 0) {
+                                           RTM_NEWNEIGH,
+                                           NLM_F_MULTI) <= 0) {
                                read_unlock_bh(&tbl->lock);
                                rc = -1;
                                goto out;
@@ -2329,14 +2337,14 @@ void neigh_app_ns(struct neighbour *n)
        if (!skb)
                return;
 
-       if (neigh_fill_info(skb, n, 0, 0, RTM_GETNEIGH) < 0) {
+       if (neigh_fill_info(skb, n, 0, 0, RTM_GETNEIGH, 0) < 0) {
                kfree_skb(skb);
                return;
        }
        nlh                        = (struct nlmsghdr *)skb->data;
        nlh->nlmsg_flags           = NLM_F_REQUEST;
-       NETLINK_CB(skb).dst_groups = RTMGRP_NEIGH;
-       netlink_broadcast(rtnl, skb, 0, RTMGRP_NEIGH, GFP_ATOMIC);
+       NETLINK_CB(skb).dst_group  = RTNLGRP_NEIGH;
+       netlink_broadcast(rtnl, skb, 0, RTNLGRP_NEIGH, GFP_ATOMIC);
 }
 
 static void neigh_app_notify(struct neighbour *n)
@@ -2348,13 +2356,13 @@ static void neigh_app_notify(struct neighbour *n)
        if (!skb)
                return;
 
-       if (neigh_fill_info(skb, n, 0, 0, RTM_NEWNEIGH) < 0) {
+       if (neigh_fill_info(skb, n, 0, 0, RTM_NEWNEIGH, 0) < 0) {
                kfree_skb(skb);
                return;
        }
        nlh                        = (struct nlmsghdr *)skb->data;
-       NETLINK_CB(skb).dst_groups = RTMGRP_NEIGH;
-       netlink_broadcast(rtnl, skb, 0, RTMGRP_NEIGH, GFP_ATOMIC);
+       NETLINK_CB(skb).dst_group  = RTNLGRP_NEIGH;
+       netlink_broadcast(rtnl, skb, 0, RTNLGRP_NEIGH, GFP_ATOMIC);
 }
 
 #endif /* CONFIG_ARPD */
@@ -2592,7 +2600,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
                t->neigh_vars[17].extra1 = dev;
        }
 
-       dev_name = net_sysctl_strdup(dev_name_source);
+       dev_name = kstrdup(dev_name_source, GFP_KERNEL);
        if (!dev_name) {
                err = -ENOBUFS;
                goto free;