]> err.no Git - linux-2.6/blobdiff - net/bluetooth/bnep/core.c
Merge branches 'release' and 'autoload' into release
[linux-2.6] / net / bluetooth / bnep / core.c
index b1c2fa96c69ee4a6045b68f8d2e9f9f232782eae..347e935faaf0a175cfb23929b92dd9bbaf5682d1 100644 (file)
@@ -2,7 +2,7 @@
    BNEP implementation for Linux Bluetooth stack (BlueZ).
    Copyright (C) 2001-2002 Inventel Systemes
    Written 2001-2002 by
-       Clément Moreau <clement.moreau@inventel.fr>
+       Clément Moreau <clement.moreau@inventel.fr>
        David Libault  <david.libault@inventel.fr>
 
    Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com>
@@ -36,8 +36,8 @@
 #include <linux/signal.h>
 #include <linux/init.h>
 #include <linux/wait.h>
+#include <linux/freezer.h>
 #include <linux/errno.h>
-#include <linux/smp_lock.h>
 #include <linux/net.h>
 #include <net/sock.h>
 
@@ -364,22 +364,25 @@ static inline int bnep_rx_frame(struct bnep_session *s, struct sk_buff *skb)
 
        case BNEP_COMPRESSED_SRC_ONLY:
                memcpy(__skb_put(nskb, ETH_ALEN), s->eh.h_dest, ETH_ALEN);
-               memcpy(__skb_put(nskb, ETH_ALEN), skb->mac.raw, ETH_ALEN);
+               memcpy(__skb_put(nskb, ETH_ALEN), skb_mac_header(skb), ETH_ALEN);
                put_unaligned(s->eh.h_proto, (__be16 *) __skb_put(nskb, 2));
                break;
 
        case BNEP_COMPRESSED_DST_ONLY:
-               memcpy(__skb_put(nskb, ETH_ALEN), skb->mac.raw, ETH_ALEN);
-               memcpy(__skb_put(nskb, ETH_ALEN + 2), s->eh.h_source, ETH_ALEN + 2);
+               memcpy(__skb_put(nskb, ETH_ALEN), skb_mac_header(skb),
+                      ETH_ALEN);
+               memcpy(__skb_put(nskb, ETH_ALEN + 2), s->eh.h_source,
+                      ETH_ALEN + 2);
                break;
 
        case BNEP_GENERAL:
-               memcpy(__skb_put(nskb, ETH_ALEN * 2), skb->mac.raw, ETH_ALEN * 2);
+               memcpy(__skb_put(nskb, ETH_ALEN * 2), skb_mac_header(skb),
+                      ETH_ALEN * 2);
                put_unaligned(s->eh.h_proto, (__be16 *) __skb_put(nskb, 2));
                break;
        }
 
-       memcpy(__skb_put(nskb, skb->len), skb->data, skb->len);
+       skb_copy_from_linear_data(skb, __skb_put(nskb, skb->len), skb->len);
        kfree_skb(skb);
 
        s->stats.rx_packets++;
@@ -472,7 +475,6 @@ static int bnep_session(void *arg)
 
        daemonize("kbnepd %s", dev->name);
        set_user_nice(current, -15);
-       current->flags |= PF_NOFREEZE;
 
        init_waitqueue_entry(&wait, current);
        add_wait_queue(sk->sk_sleep, &wait);