]> err.no Git - linux-2.6/blobdiff - drivers/block/aoe/aoenet.c
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
[linux-2.6] / drivers / block / aoe / aoenet.c
index f9ddfda4d9cb5945e3800e4a6865691e6069765f..d625169c8e48a99951cbb3f833755f77ee0eca1f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006 Coraid, Inc.  See COPYING for GPL terms. */
+/* Copyright (c) 2007 Coraid, Inc.  See COPYING for GPL terms. */
 /*
  * aoenet.c
  * Ethernet portion of AoE driver
@@ -8,6 +8,7 @@
 #include <linux/blkdev.h>
 #include <linux/netdevice.h>
 #include <linux/moduleparam.h>
+#include <net/net_namespace.h>
 #include <asm/unaligned.h>
 #include "aoe.h"
 
@@ -82,7 +83,7 @@ set_aoe_iflist(const char __user *user_str, size_t size)
        return 0;
 }
 
-u64
+unsigned long long
 mac_addr(char addr[6])
 {
        __be64 n = 0;
@@ -90,7 +91,7 @@ mac_addr(char addr[6])
 
        memcpy(p + 2, addr, 6); /* (sizeof addr != 6) */
 
-       return __be64_to_cpu(n);
+       return (unsigned long long) __be64_to_cpu(n);
 }
 
 void
@@ -114,6 +115,9 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
        struct aoe_hdr *h;
        u32 n;
 
+       if (dev_net(ifp) != &init_net)
+               goto exit;
+
        skb = skb_share_check(skb, GFP_ATOMIC);
        if (skb == NULL)
                return 0;
@@ -123,8 +127,8 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
                goto exit;
        skb_push(skb, ETH_HLEN);        /* (1) */
 
-       h = aoe_hdr(skb);
-       n = be32_to_cpu(get_unaligned(&h->tag));
+       h = (struct aoe_hdr *) skb_mac_header(skb);
+       n = get_unaligned_be32(&h->tag);
        if ((h->verfl & AOEFL_RSP) == 0 || (n & 1<<31))
                goto exit;
 
@@ -133,9 +137,12 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
                if (n > NECODES)
                        n = 0;
                if (net_ratelimit())
-                       printk(KERN_ERR "aoe: error packet from %d.%d; ecode=%d '%s'\n",
-                              be16_to_cpu(get_unaligned(&h->major)), h->minor,
-                              h->err, aoe_errlist[n]);
+                       printk(KERN_ERR
+                               "%s%d.%d@%s; ecode=%d '%s'\n",
+                               "aoe: error packet from ",
+                               get_unaligned_be16(&h->major),
+                               h->minor, skb->dev->name,
+                               h->err, aoe_errlist[n]);
                goto exit;
        }