appletalk: Fix socket referencing in skb
[pandora-kernel.git] / net / appletalk / ddp.c
index 02806c6..bfcf6be 100644 (file)
@@ -293,7 +293,7 @@ static int atif_probe_device(struct atalk_iface *atif)
 
 /* Perform AARP probing for a proxy address */
 static int atif_proxy_probe_device(struct atalk_iface *atif,
-                                  struct atalk_addrproxy_addr)
+                                  struct atalk_addr *proxy_addr)
 {
        int netrange = ntohs(atif->nets.nr_lastnet) -
                        ntohs(atif->nets.nr_firstnet) + 1;
@@ -581,7 +581,7 @@ out:
 }
 
 /* Delete a route. Find it and discard it */
-static int atrtr_delete(struct atalk_addr * addr)
+static int atrtr_delete(struct atalk_addr *addr)
 {
        struct atalk_route **r = &atalk_routes;
        int retval = 0;
@@ -936,11 +936,11 @@ static unsigned long atalk_sum_skb(const struct sk_buff *skb, int offset,
        int i, copy;
 
        /* checksum stuff in header space */
-       if ( (copy = start - offset) > 0) {
+       if ((copy = start - offset) > 0) {
                if (copy > len)
                        copy = len;
                sum = atalk_sum_partial(skb->data + offset, copy, sum);
-               if ( (len -= copy) == 0)
+               if ((len -= copy) == 0)
                        return sum;
 
                offset += copy;
@@ -1151,7 +1151,7 @@ static int atalk_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
                        goto out;
 
                at->src_net  = addr->sat_addr.s_net = ap->s_net;
-               at->src_node = addr->sat_addr.s_node= ap->s_node;
+               at->src_node = addr->sat_addr.s_node = ap->s_node;
        } else {
                err = -EADDRNOTAVAIL;
                if (!atalk_find_interface(addr->sat_addr.s_net,
@@ -1489,8 +1489,6 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
                goto drop;
 
        /* Queue packet (standard) */
-       skb->sk = sock;
-
        if (sock_queue_rcv_skb(sock, skb) < 0)
                goto drop;
 
@@ -1644,7 +1642,6 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
        if (!skb)
                goto out;
 
-       skb->sk = sk;
        skb_reserve(skb, ddp_dl->header_length);
        skb_reserve(skb, dev->hard_header_len);
        skb->dev = dev;
@@ -1669,7 +1666,7 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
                goto out;
        }
 
-       if (sk->sk_no_check == 1)
+       if (sk->sk_no_check_tx)
                ddp->deh_sum = 0;
        else
                ddp->deh_sum = atalk_checksum(skb, len + sizeof(*ddp));
@@ -1790,53 +1787,53 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
        void __user *argp = (void __user *)arg;
 
        switch (cmd) {
-               /* Protocol layer */
-               case TIOCOUTQ: {
-                       long amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
+       /* Protocol layer */
+       case TIOCOUTQ: {
+               long amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
 
-                       if (amount < 0)
-                               amount = 0;
-                       rc = put_user(amount, (int __user *)argp);
-                       break;
-               }
-               case TIOCINQ: {
-                       /*
-                        * These two are safe on a single CPU system as only
-                        * user tasks fiddle here
-                        */
-                       struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
-                       long amount = 0;
+               if (amount < 0)
+                       amount = 0;
+               rc = put_user(amount, (int __user *)argp);
+               break;
+       }
+       case TIOCINQ: {
+               /*
+                * These two are safe on a single CPU system as only
+                * user tasks fiddle here
+                */
+               struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
+               long amount = 0;
 
-                       if (skb)
-                               amount = skb->len - sizeof(struct ddpehdr);
-                       rc = put_user(amount, (int __user *)argp);
-                       break;
-               }
-               case SIOCGSTAMP:
-                       rc = sock_get_timestamp(sk, argp);
-                       break;
-               case SIOCGSTAMPNS:
-                       rc = sock_get_timestampns(sk, argp);
-                       break;
-               /* Routing */
-               case SIOCADDRT:
-               case SIOCDELRT:
-                       rc = -EPERM;
-                       if (capable(CAP_NET_ADMIN))
-                               rc = atrtr_ioctl(cmd, argp);
-                       break;
-               /* Interface */
-               case SIOCGIFADDR:
-               case SIOCSIFADDR:
-               case SIOCGIFBRDADDR:
-               case SIOCATALKDIFADDR:
-               case SIOCDIFADDR:
-               case SIOCSARP:          /* proxy AARP */
-               case SIOCDARP:          /* proxy AARP */
-                       rtnl_lock();
-                       rc = atif_ioctl(cmd, argp);
-                       rtnl_unlock();
-                       break;
+               if (skb)
+               amount = skb->len - sizeof(struct ddpehdr);
+               rc = put_user(amount, (int __user *)argp);
+               break;
+       }
+       case SIOCGSTAMP:
+               rc = sock_get_timestamp(sk, argp);
+               break;
+       case SIOCGSTAMPNS:
+               rc = sock_get_timestampns(sk, argp);
+               break;
+       /* Routing */
+       case SIOCADDRT:
+       case SIOCDELRT:
+               rc = -EPERM;
+               if (capable(CAP_NET_ADMIN))
+                       rc = atrtr_ioctl(cmd, argp);
+               break;
+       /* Interface */
+       case SIOCGIFADDR:
+       case SIOCSIFADDR:
+       case SIOCGIFBRDADDR:
+       case SIOCATALKDIFADDR:
+       case SIOCDIFADDR:
+       case SIOCSARP:          /* proxy AARP */
+       case SIOCDARP:          /* proxy AARP */
+               rtnl_lock();
+               rc = atif_ioctl(cmd, argp);
+               rtnl_unlock();
+               break;
        }
 
        return rc;