]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/net/neighbour.h
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfashe...
[linux-2.6-omap-h63xx.git] / include / net / neighbour.h
index 74c4b6ff8a5c52b8c3cd8af39d40c07ef2b97de4..ad7fe1121412a013c67c7638ab3907b28716bb61 100644 (file)
@@ -36,7 +36,7 @@ struct neigh_parms
        struct net_device *dev;
        struct neigh_parms *next;
        int     (*neigh_setup)(struct neighbour *);
-       void    (*neigh_destructor)(struct neighbour *);
+       void    (*neigh_cleanup)(struct neighbour *);
        struct neigh_table *tbl;
 
        void    *sysctl_table;
@@ -101,7 +101,7 @@ struct neighbour
        __u8                    dead;
        atomic_t                probes;
        rwlock_t                lock;
-       unsigned char           ha[(MAX_ADDR_LEN+sizeof(unsigned long)-1)&~(sizeof(unsigned long)-1)];
+       unsigned char           ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))];
        struct hh_cache         *hh;
        atomic_t                refcnt;
        int                     (*output)(struct sk_buff *skb);
@@ -126,6 +126,7 @@ struct pneigh_entry
 {
        struct pneigh_entry     *next;
        struct net_device               *dev;
+       u8                      flags;
        u8                      key[0];
 };
 
@@ -159,7 +160,7 @@ struct neigh_table
        atomic_t                entries;
        rwlock_t                lock;
        unsigned long           last_rand;
-       kmem_cache_t            *kmem_cachep;
+       struct kmem_cache               *kmem_cachep;
        struct neigh_statistics *stats;
        struct neighbour        **hash_buckets;
        unsigned int            hash_mask;
@@ -308,6 +309,24 @@ static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
        return 0;
 }
 
+static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb)
+{
+       unsigned seq;
+       int hh_len;
+
+       do {
+               int hh_alen;
+
+               seq = read_seqbegin(&hh->hh_lock);
+               hh_len = hh->hh_len;
+               hh_alen = HH_DATA_ALIGN(hh_len);
+               memcpy(skb->data - hh_alen, hh->hh_data, hh_alen);
+       } while (read_seqretry(&hh->hh_lock, seq));
+
+       skb_push(skb, hh_len);
+       return hh->hh_output(skb);
+}
+
 static inline struct neighbour *
 __neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat)
 {