Merge branch 'audit.b37' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit...
[pandora-kernel.git] / net / x25 / x25_dev.c
index adfe7b8..c7221de 100644 (file)
@@ -1,8 +1,8 @@
 /*
  *     X.25 Packet Layer release 002
  *
- *     This is ALPHA test software. This code may break your machine, randomly fail to work with new 
- *     releases, misbehave and/or generally screw up. It might even work. 
+ *     This is ALPHA test software. This code may break your machine, randomly fail to work with new
+ *     releases, misbehave and/or generally screw up. It might even work.
  *
  *     This code REQUIRES 2.1.15 or higher
  *
@@ -17,7 +17,6 @@
  *      2000-09-04     Henner Eisen    Prevent freeing a dangling skb.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
@@ -32,7 +31,7 @@ static int x25_receive_data(struct sk_buff *skb, struct x25_neigh *nb)
        unsigned int lci;
 
        frametype = skb->data[2];
-        lci = ((skb->data[0] << 8) & 0xF00) + ((skb->data[1] << 0) & 0x0FF);
+       lci = ((skb->data[0] << 8) & 0xF00) + ((skb->data[1] << 0) & 0x0FF);
 
        /*
         *      LCI of zero is always for us, and its always a link control
@@ -57,6 +56,7 @@ static int x25_receive_data(struct sk_buff *skb, struct x25_neigh *nb)
                        sk_add_backlog(sk, skb);
                }
                bh_unlock_sock(sk);
+               sock_put(sk);
                return queued;
        }
 
@@ -67,9 +67,18 @@ static int x25_receive_data(struct sk_buff *skb, struct x25_neigh *nb)
                return x25_rx_call_request(skb, nb, lci);
 
        /*
-        *      Its not a Call Request, nor is it a control frame.
-        *      Let caller throw it away.
+        *      Its not a Call Request, nor is it a control frame.
+        *      Can we forward it?
         */
+
+       if (x25_forward_data(lci, nb, skb)) {
+               if (frametype == X25_CLEAR_CONFIRMATION) {
+                       x25_clear_forward_by_lci(lci);
+               }
+               kfree_skb(skb);
+               return 1;
+       }
+
 /*
        x25_transmit_clear_request(nb, lci, 0x0D);
 */