11da177e4SLinus Torvalds /* 21da177e4SLinus Torvalds * X.25 Packet Layer release 002 31da177e4SLinus Torvalds * 41da177e4SLinus Torvalds * This is ALPHA test software. This code may break your machine, 51da177e4SLinus Torvalds * randomly fail to work with new releases, misbehave and/or generally 61da177e4SLinus Torvalds * screw up. It might even work. 71da177e4SLinus Torvalds * 81da177e4SLinus Torvalds * This code REQUIRES 2.1.15 or higher 91da177e4SLinus Torvalds * 101da177e4SLinus Torvalds * This module: 111da177e4SLinus Torvalds * This module is free software; you can redistribute it and/or 121da177e4SLinus Torvalds * modify it under the terms of the GNU General Public License 131da177e4SLinus Torvalds * as published by the Free Software Foundation; either version 141da177e4SLinus Torvalds * 2 of the License, or (at your option) any later version. 151da177e4SLinus Torvalds * 161da177e4SLinus Torvalds * History 171da177e4SLinus Torvalds * X.25 001 Jonathan Naylor Started coding. 181da177e4SLinus Torvalds * X.25 002 Jonathan Naylor Centralised disconnection code. 191da177e4SLinus Torvalds * New timer architecture. 201da177e4SLinus Torvalds * 2000-03-20 Daniela Squassoni Disabling/enabling of facilities 211da177e4SLinus Torvalds * negotiation. 221da177e4SLinus Torvalds * 2000-11-10 Henner Eisen Check and reset for out-of-sequence 231da177e4SLinus Torvalds * i-frames. 241da177e4SLinus Torvalds */ 251da177e4SLinus Torvalds 265a0e3ad6STejun Heo #include <linux/slab.h> 271da177e4SLinus Torvalds #include <linux/errno.h> 281da177e4SLinus Torvalds #include <linux/kernel.h> 291da177e4SLinus Torvalds #include <linux/string.h> 301da177e4SLinus Torvalds #include <linux/skbuff.h> 311da177e4SLinus Torvalds #include <net/sock.h> 32c752f073SArnaldo Carvalho de Melo #include <net/tcp_states.h> 331da177e4SLinus Torvalds #include <net/x25.h> 341da177e4SLinus Torvalds 351da177e4SLinus Torvalds static int x25_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more) 361da177e4SLinus Torvalds { 371da177e4SLinus Torvalds struct sk_buff *skbo, *skbn = skb; 381da177e4SLinus Torvalds struct x25_sock *x25 = x25_sk(sk); 391da177e4SLinus Torvalds 401da177e4SLinus Torvalds if (more) { 411da177e4SLinus Torvalds x25->fraglen += skb->len; 421da177e4SLinus Torvalds skb_queue_tail(&x25->fragment_queue, skb); 431da177e4SLinus Torvalds skb_set_owner_r(skb, sk); 441da177e4SLinus Torvalds return 0; 451da177e4SLinus Torvalds } 461da177e4SLinus Torvalds 471da177e4SLinus Torvalds if (!more && x25->fraglen > 0) { /* End of fragment */ 481da177e4SLinus Torvalds int len = x25->fraglen + skb->len; 491da177e4SLinus Torvalds 501da177e4SLinus Torvalds if ((skbn = alloc_skb(len, GFP_ATOMIC)) == NULL){ 511da177e4SLinus Torvalds kfree_skb(skb); 521da177e4SLinus Torvalds return 1; 531da177e4SLinus Torvalds } 541da177e4SLinus Torvalds 551da177e4SLinus Torvalds skb_queue_tail(&x25->fragment_queue, skb); 561da177e4SLinus Torvalds 57badff6d0SArnaldo Carvalho de Melo skb_reset_transport_header(skbn); 581da177e4SLinus Torvalds 591da177e4SLinus Torvalds skbo = skb_dequeue(&x25->fragment_queue); 601a4e2d09SArnaldo Carvalho de Melo skb_copy_from_linear_data(skbo, skb_put(skbn, skbo->len), 611a4e2d09SArnaldo Carvalho de Melo skbo->len); 621da177e4SLinus Torvalds kfree_skb(skbo); 631da177e4SLinus Torvalds 641da177e4SLinus Torvalds while ((skbo = 651da177e4SLinus Torvalds skb_dequeue(&x25->fragment_queue)) != NULL) { 661da177e4SLinus Torvalds skb_pull(skbo, (x25->neighbour->extended) ? 671da177e4SLinus Torvalds X25_EXT_MIN_LEN : X25_STD_MIN_LEN); 681a4e2d09SArnaldo Carvalho de Melo skb_copy_from_linear_data(skbo, 691a4e2d09SArnaldo Carvalho de Melo skb_put(skbn, skbo->len), 701a4e2d09SArnaldo Carvalho de Melo skbo->len); 711da177e4SLinus Torvalds kfree_skb(skbo); 721da177e4SLinus Torvalds } 731da177e4SLinus Torvalds 741da177e4SLinus Torvalds x25->fraglen = 0; 751da177e4SLinus Torvalds } 761da177e4SLinus Torvalds 771da177e4SLinus Torvalds skb_set_owner_r(skbn, sk); 781da177e4SLinus Torvalds skb_queue_tail(&sk->sk_receive_queue, skbn); 791da177e4SLinus Torvalds if (!sock_flag(sk, SOCK_DEAD)) 801da177e4SLinus Torvalds sk->sk_data_ready(sk, skbn->len); 811da177e4SLinus Torvalds 821da177e4SLinus Torvalds return 0; 831da177e4SLinus Torvalds } 841da177e4SLinus Torvalds 851da177e4SLinus Torvalds /* 861da177e4SLinus Torvalds * State machine for state 1, Awaiting Call Accepted State. 871da177e4SLinus Torvalds * The handling of the timer(s) is in file x25_timer.c. 881da177e4SLinus Torvalds * Handling of state 0 and connection release is in af_x25.c. 891da177e4SLinus Torvalds */ 901da177e4SLinus Torvalds static int x25_state1_machine(struct sock *sk, struct sk_buff *skb, int frametype) 911da177e4SLinus Torvalds { 921da177e4SLinus Torvalds struct x25_address source_addr, dest_addr; 93f5eb917bSJohn Hughes int len; 9495c30430Sandrew hendry struct x25_sock *x25 = x25_sk(sk); 951da177e4SLinus Torvalds 961da177e4SLinus Torvalds switch (frametype) { 971da177e4SLinus Torvalds case X25_CALL_ACCEPTED: { 981da177e4SLinus Torvalds 991da177e4SLinus Torvalds x25_stop_timer(sk); 1001da177e4SLinus Torvalds x25->condition = 0x00; 1011da177e4SLinus Torvalds x25->vs = 0; 1021da177e4SLinus Torvalds x25->va = 0; 1031da177e4SLinus Torvalds x25->vr = 0; 1041da177e4SLinus Torvalds x25->vl = 0; 1051da177e4SLinus Torvalds x25->state = X25_STATE_3; 1061da177e4SLinus Torvalds sk->sk_state = TCP_ESTABLISHED; 1071da177e4SLinus Torvalds /* 1081da177e4SLinus Torvalds * Parse the data in the frame. 1091da177e4SLinus Torvalds */ 1101da177e4SLinus Torvalds skb_pull(skb, X25_STD_MIN_LEN); 111f5eb917bSJohn Hughes 112f5eb917bSJohn Hughes len = x25_parse_address_block(skb, &source_addr, 113f5eb917bSJohn Hughes &dest_addr); 114f5eb917bSJohn Hughes if (len > 0) 115f5eb917bSJohn Hughes skb_pull(skb, len); 11695c30430Sandrew hendry else if (len < 0) 11795c30430Sandrew hendry goto out_clear; 118f5eb917bSJohn Hughes 119f5eb917bSJohn Hughes len = x25_parse_facilities(skb, &x25->facilities, 120a64b7b93SShaun Pereira &x25->dte_facilities, 121f5eb917bSJohn Hughes &x25->vc_facil_mask); 122f5eb917bSJohn Hughes if (len > 0) 123f5eb917bSJohn Hughes skb_pull(skb, len); 12495c30430Sandrew hendry else if (len < 0) 12595c30430Sandrew hendry goto out_clear; 1261da177e4SLinus Torvalds /* 1271da177e4SLinus Torvalds * Copy any Call User Data. 1281da177e4SLinus Torvalds */ 129091bb8abSroel kluin if (skb->len > 0) { 130*c7fd0d48SMatthew Daley if (skb->len > X25_MAX_CUD_LEN) 131*c7fd0d48SMatthew Daley goto out_clear; 132*c7fd0d48SMatthew Daley 133d626f62bSArnaldo Carvalho de Melo skb_copy_from_linear_data(skb, 134d626f62bSArnaldo Carvalho de Melo x25->calluserdata.cuddata, 1351da177e4SLinus Torvalds skb->len); 1361da177e4SLinus Torvalds x25->calluserdata.cudlength = skb->len; 1371da177e4SLinus Torvalds } 1381da177e4SLinus Torvalds if (!sock_flag(sk, SOCK_DEAD)) 1391da177e4SLinus Torvalds sk->sk_state_change(sk); 1401da177e4SLinus Torvalds break; 1411da177e4SLinus Torvalds } 1421da177e4SLinus Torvalds case X25_CLEAR_REQUEST: 1431da177e4SLinus Torvalds x25_write_internal(sk, X25_CLEAR_CONFIRMATION); 1441da177e4SLinus Torvalds x25_disconnect(sk, ECONNREFUSED, skb->data[3], skb->data[4]); 1451da177e4SLinus Torvalds break; 1461da177e4SLinus Torvalds 1471da177e4SLinus Torvalds default: 1481da177e4SLinus Torvalds break; 1491da177e4SLinus Torvalds } 1501da177e4SLinus Torvalds 1511da177e4SLinus Torvalds return 0; 15295c30430Sandrew hendry 15395c30430Sandrew hendry out_clear: 15495c30430Sandrew hendry x25_write_internal(sk, X25_CLEAR_REQUEST); 15595c30430Sandrew hendry x25->state = X25_STATE_2; 15695c30430Sandrew hendry x25_start_t23timer(sk); 15795c30430Sandrew hendry return 0; 1581da177e4SLinus Torvalds } 1591da177e4SLinus Torvalds 1601da177e4SLinus Torvalds /* 1611da177e4SLinus Torvalds * State machine for state 2, Awaiting Clear Confirmation State. 1621da177e4SLinus Torvalds * The handling of the timer(s) is in file x25_timer.c 1631da177e4SLinus Torvalds * Handling of state 0 and connection release is in af_x25.c. 1641da177e4SLinus Torvalds */ 1651da177e4SLinus Torvalds static int x25_state2_machine(struct sock *sk, struct sk_buff *skb, int frametype) 1661da177e4SLinus Torvalds { 1671da177e4SLinus Torvalds switch (frametype) { 1681da177e4SLinus Torvalds 1691da177e4SLinus Torvalds case X25_CLEAR_REQUEST: 1701da177e4SLinus Torvalds x25_write_internal(sk, X25_CLEAR_CONFIRMATION); 1711da177e4SLinus Torvalds x25_disconnect(sk, 0, skb->data[3], skb->data[4]); 1721da177e4SLinus Torvalds break; 1731da177e4SLinus Torvalds 1741da177e4SLinus Torvalds case X25_CLEAR_CONFIRMATION: 1751da177e4SLinus Torvalds x25_disconnect(sk, 0, 0, 0); 1761da177e4SLinus Torvalds break; 1771da177e4SLinus Torvalds 1781da177e4SLinus Torvalds default: 1791da177e4SLinus Torvalds break; 1801da177e4SLinus Torvalds } 1811da177e4SLinus Torvalds 1821da177e4SLinus Torvalds return 0; 1831da177e4SLinus Torvalds } 1841da177e4SLinus Torvalds 1851da177e4SLinus Torvalds /* 1861da177e4SLinus Torvalds * State machine for state 3, Connected State. 1871da177e4SLinus Torvalds * The handling of the timer(s) is in file x25_timer.c 1881da177e4SLinus Torvalds * Handling of state 0 and connection release is in af_x25.c. 1891da177e4SLinus Torvalds */ 1901da177e4SLinus Torvalds static int x25_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype, int ns, int nr, int q, int d, int m) 1911da177e4SLinus Torvalds { 1921da177e4SLinus Torvalds int queued = 0; 1931da177e4SLinus Torvalds int modulus; 1941da177e4SLinus Torvalds struct x25_sock *x25 = x25_sk(sk); 1951da177e4SLinus Torvalds 1961da177e4SLinus Torvalds modulus = (x25->neighbour->extended) ? X25_EMODULUS : X25_SMODULUS; 1971da177e4SLinus Torvalds 1981da177e4SLinus Torvalds switch (frametype) { 1991da177e4SLinus Torvalds 2001da177e4SLinus Torvalds case X25_RESET_REQUEST: 2011da177e4SLinus Torvalds x25_write_internal(sk, X25_RESET_CONFIRMATION); 2021da177e4SLinus Torvalds x25_stop_timer(sk); 2031da177e4SLinus Torvalds x25->condition = 0x00; 2041da177e4SLinus Torvalds x25->vs = 0; 2051da177e4SLinus Torvalds x25->vr = 0; 2061da177e4SLinus Torvalds x25->va = 0; 2071da177e4SLinus Torvalds x25->vl = 0; 2081da177e4SLinus Torvalds x25_requeue_frames(sk); 2091da177e4SLinus Torvalds break; 2101da177e4SLinus Torvalds 2111da177e4SLinus Torvalds case X25_CLEAR_REQUEST: 2121da177e4SLinus Torvalds x25_write_internal(sk, X25_CLEAR_CONFIRMATION); 2131da177e4SLinus Torvalds x25_disconnect(sk, 0, skb->data[3], skb->data[4]); 2141da177e4SLinus Torvalds break; 2151da177e4SLinus Torvalds 2161da177e4SLinus Torvalds case X25_RR: 2171da177e4SLinus Torvalds case X25_RNR: 2181da177e4SLinus Torvalds if (!x25_validate_nr(sk, nr)) { 2191da177e4SLinus Torvalds x25_clear_queues(sk); 2201da177e4SLinus Torvalds x25_write_internal(sk, X25_RESET_REQUEST); 2211da177e4SLinus Torvalds x25_start_t22timer(sk); 2221da177e4SLinus Torvalds x25->condition = 0x00; 2231da177e4SLinus Torvalds x25->vs = 0; 2241da177e4SLinus Torvalds x25->vr = 0; 2251da177e4SLinus Torvalds x25->va = 0; 2261da177e4SLinus Torvalds x25->vl = 0; 2271da177e4SLinus Torvalds x25->state = X25_STATE_4; 2281da177e4SLinus Torvalds } else { 2291da177e4SLinus Torvalds x25_frames_acked(sk, nr); 2301da177e4SLinus Torvalds if (frametype == X25_RNR) { 2311da177e4SLinus Torvalds x25->condition |= X25_COND_PEER_RX_BUSY; 2321da177e4SLinus Torvalds } else { 2331da177e4SLinus Torvalds x25->condition &= ~X25_COND_PEER_RX_BUSY; 2341da177e4SLinus Torvalds } 2351da177e4SLinus Torvalds } 2361da177e4SLinus Torvalds break; 2371da177e4SLinus Torvalds 2381da177e4SLinus Torvalds case X25_DATA: /* XXX */ 2391da177e4SLinus Torvalds x25->condition &= ~X25_COND_PEER_RX_BUSY; 2401da177e4SLinus Torvalds if ((ns != x25->vr) || !x25_validate_nr(sk, nr)) { 2411da177e4SLinus Torvalds x25_clear_queues(sk); 2421da177e4SLinus Torvalds x25_write_internal(sk, X25_RESET_REQUEST); 2431da177e4SLinus Torvalds x25_start_t22timer(sk); 2441da177e4SLinus Torvalds x25->condition = 0x00; 2451da177e4SLinus Torvalds x25->vs = 0; 2461da177e4SLinus Torvalds x25->vr = 0; 2471da177e4SLinus Torvalds x25->va = 0; 2481da177e4SLinus Torvalds x25->vl = 0; 2491da177e4SLinus Torvalds x25->state = X25_STATE_4; 2501da177e4SLinus Torvalds break; 2511da177e4SLinus Torvalds } 2521da177e4SLinus Torvalds x25_frames_acked(sk, nr); 2531da177e4SLinus Torvalds if (ns == x25->vr) { 2541da177e4SLinus Torvalds if (x25_queue_rx_frame(sk, skb, m) == 0) { 2551da177e4SLinus Torvalds x25->vr = (x25->vr + 1) % modulus; 2561da177e4SLinus Torvalds queued = 1; 2571da177e4SLinus Torvalds } else { 2581da177e4SLinus Torvalds /* Should never happen */ 2591da177e4SLinus Torvalds x25_clear_queues(sk); 2601da177e4SLinus Torvalds x25_write_internal(sk, X25_RESET_REQUEST); 2611da177e4SLinus Torvalds x25_start_t22timer(sk); 2621da177e4SLinus Torvalds x25->condition = 0x00; 2631da177e4SLinus Torvalds x25->vs = 0; 2641da177e4SLinus Torvalds x25->vr = 0; 2651da177e4SLinus Torvalds x25->va = 0; 2661da177e4SLinus Torvalds x25->vl = 0; 2671da177e4SLinus Torvalds x25->state = X25_STATE_4; 2681da177e4SLinus Torvalds break; 2691da177e4SLinus Torvalds } 2701da177e4SLinus Torvalds if (atomic_read(&sk->sk_rmem_alloc) > 2716bf1574eSEric Dumazet (sk->sk_rcvbuf >> 1)) 2721da177e4SLinus Torvalds x25->condition |= X25_COND_OWN_RX_BUSY; 2731da177e4SLinus Torvalds } 2741da177e4SLinus Torvalds /* 2751da177e4SLinus Torvalds * If the window is full Ack it immediately, else 2761da177e4SLinus Torvalds * start the holdback timer. 2771da177e4SLinus Torvalds */ 2781da177e4SLinus Torvalds if (((x25->vl + x25->facilities.winsize_in) % modulus) == x25->vr) { 2791da177e4SLinus Torvalds x25->condition &= ~X25_COND_ACK_PENDING; 2801da177e4SLinus Torvalds x25_stop_timer(sk); 2811da177e4SLinus Torvalds x25_enquiry_response(sk); 2821da177e4SLinus Torvalds } else { 2831da177e4SLinus Torvalds x25->condition |= X25_COND_ACK_PENDING; 2841da177e4SLinus Torvalds x25_start_t2timer(sk); 2851da177e4SLinus Torvalds } 2861da177e4SLinus Torvalds break; 2871da177e4SLinus Torvalds 2881da177e4SLinus Torvalds case X25_INTERRUPT_CONFIRMATION: 289b7792e34Sandrew hendry clear_bit(X25_INTERRUPT_FLAG, &x25->flags); 2901da177e4SLinus Torvalds break; 2911da177e4SLinus Torvalds 2921da177e4SLinus Torvalds case X25_INTERRUPT: 2931da177e4SLinus Torvalds if (sock_flag(sk, SOCK_URGINLINE)) 2941da177e4SLinus Torvalds queued = !sock_queue_rcv_skb(sk, skb); 2951da177e4SLinus Torvalds else { 2961da177e4SLinus Torvalds skb_set_owner_r(skb, sk); 2971da177e4SLinus Torvalds skb_queue_tail(&x25->interrupt_in_queue, skb); 2981da177e4SLinus Torvalds queued = 1; 2991da177e4SLinus Torvalds } 3001da177e4SLinus Torvalds sk_send_sigurg(sk); 3011da177e4SLinus Torvalds x25_write_internal(sk, X25_INTERRUPT_CONFIRMATION); 3021da177e4SLinus Torvalds break; 3031da177e4SLinus Torvalds 3041da177e4SLinus Torvalds default: 3051da177e4SLinus Torvalds printk(KERN_WARNING "x25: unknown %02X in state 3\n", frametype); 3061da177e4SLinus Torvalds break; 3071da177e4SLinus Torvalds } 3081da177e4SLinus Torvalds 3091da177e4SLinus Torvalds return queued; 3101da177e4SLinus Torvalds } 3111da177e4SLinus Torvalds 3121da177e4SLinus Torvalds /* 3131da177e4SLinus Torvalds * State machine for state 4, Awaiting Reset Confirmation State. 3141da177e4SLinus Torvalds * The handling of the timer(s) is in file x25_timer.c 3151da177e4SLinus Torvalds * Handling of state 0 and connection release is in af_x25.c. 3161da177e4SLinus Torvalds */ 3171da177e4SLinus Torvalds static int x25_state4_machine(struct sock *sk, struct sk_buff *skb, int frametype) 3181da177e4SLinus Torvalds { 3191da177e4SLinus Torvalds switch (frametype) { 3201da177e4SLinus Torvalds 3211da177e4SLinus Torvalds case X25_RESET_REQUEST: 3221da177e4SLinus Torvalds x25_write_internal(sk, X25_RESET_CONFIRMATION); 3231da177e4SLinus Torvalds case X25_RESET_CONFIRMATION: { 3241da177e4SLinus Torvalds struct x25_sock *x25 = x25_sk(sk); 3251da177e4SLinus Torvalds 3261da177e4SLinus Torvalds x25_stop_timer(sk); 3271da177e4SLinus Torvalds x25->condition = 0x00; 3281da177e4SLinus Torvalds x25->va = 0; 3291da177e4SLinus Torvalds x25->vr = 0; 3301da177e4SLinus Torvalds x25->vs = 0; 3311da177e4SLinus Torvalds x25->vl = 0; 3321da177e4SLinus Torvalds x25->state = X25_STATE_3; 3331da177e4SLinus Torvalds x25_requeue_frames(sk); 3341da177e4SLinus Torvalds break; 3351da177e4SLinus Torvalds } 3361da177e4SLinus Torvalds case X25_CLEAR_REQUEST: 3371da177e4SLinus Torvalds x25_write_internal(sk, X25_CLEAR_CONFIRMATION); 3381da177e4SLinus Torvalds x25_disconnect(sk, 0, skb->data[3], skb->data[4]); 3391da177e4SLinus Torvalds break; 3401da177e4SLinus Torvalds 3411da177e4SLinus Torvalds default: 3421da177e4SLinus Torvalds break; 3431da177e4SLinus Torvalds } 3441da177e4SLinus Torvalds 3451da177e4SLinus Torvalds return 0; 3461da177e4SLinus Torvalds } 3471da177e4SLinus Torvalds 3481da177e4SLinus Torvalds /* Higher level upcall for a LAPB frame */ 3491da177e4SLinus Torvalds int x25_process_rx_frame(struct sock *sk, struct sk_buff *skb) 3501da177e4SLinus Torvalds { 3511da177e4SLinus Torvalds struct x25_sock *x25 = x25_sk(sk); 3521da177e4SLinus Torvalds int queued = 0, frametype, ns, nr, q, d, m; 3531da177e4SLinus Torvalds 3541da177e4SLinus Torvalds if (x25->state == X25_STATE_0) 3551da177e4SLinus Torvalds return 0; 3561da177e4SLinus Torvalds 3571da177e4SLinus Torvalds frametype = x25_decode(sk, skb, &ns, &nr, &q, &d, &m); 3581da177e4SLinus Torvalds 3591da177e4SLinus Torvalds switch (x25->state) { 3601da177e4SLinus Torvalds case X25_STATE_1: 3611da177e4SLinus Torvalds queued = x25_state1_machine(sk, skb, frametype); 3621da177e4SLinus Torvalds break; 3631da177e4SLinus Torvalds case X25_STATE_2: 3641da177e4SLinus Torvalds queued = x25_state2_machine(sk, skb, frametype); 3651da177e4SLinus Torvalds break; 3661da177e4SLinus Torvalds case X25_STATE_3: 3671da177e4SLinus Torvalds queued = x25_state3_machine(sk, skb, frametype, ns, nr, q, d, m); 3681da177e4SLinus Torvalds break; 3691da177e4SLinus Torvalds case X25_STATE_4: 3701da177e4SLinus Torvalds queued = x25_state4_machine(sk, skb, frametype); 3711da177e4SLinus Torvalds break; 3721da177e4SLinus Torvalds } 3731da177e4SLinus Torvalds 3741da177e4SLinus Torvalds x25_kick(sk); 3751da177e4SLinus Torvalds 3761da177e4SLinus Torvalds return queued; 3771da177e4SLinus Torvalds } 3781da177e4SLinus Torvalds 3791da177e4SLinus Torvalds int x25_backlog_rcv(struct sock *sk, struct sk_buff *skb) 3801da177e4SLinus Torvalds { 3811da177e4SLinus Torvalds int queued = x25_process_rx_frame(sk, skb); 3821da177e4SLinus Torvalds 3831da177e4SLinus Torvalds if (!queued) 3841da177e4SLinus Torvalds kfree_skb(skb); 3851da177e4SLinus Torvalds 3861da177e4SLinus Torvalds return 0; 3871da177e4SLinus Torvalds } 388