X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fllc%2Fllc_if.c;h=a89917130a7bd76e4aa9e64c4b2c8a1b78b6723a;hb=refs%2Fheads%2Fvserver;hp=0f9fc48aeaf916318a2198283ab007b08e96df27;hpb=f7f1b0f1e2fbadeab12d24236000e778aa9b1ead;p=linux-2.6.git diff --git a/net/llc/llc_if.c b/net/llc/llc_if.c index 0f9fc48ae..a89917130 100644 --- a/net/llc/llc_if.c +++ b/net/llc/llc_if.c @@ -11,11 +11,9 @@ * * See the GNU General Public License for more details. */ -#include #include #include #include -#include #include #include #include @@ -25,8 +23,7 @@ #include #include #include - -u8 llc_mac_null_var[IFHWADDRLEN]; +#include /** * llc_build_and_send_pkt - Connection data sending for upper layers. @@ -47,14 +44,11 @@ int llc_build_and_send_pkt(struct sock *sk, struct sk_buff *skb) int rc = -ECONNABORTED; struct llc_sock *llc = llc_sk(sk); - if (llc->state == LLC_CONN_STATE_ADM) + if (unlikely(llc->state == LLC_CONN_STATE_ADM)) goto out; rc = -EBUSY; - if (llc_data_accept_state(llc->state)) { /* data_conn_refuse */ - llc->failed_data_req = 1; - goto out; - } - if (llc->p_flag) { + if (unlikely(llc_data_accept_state(llc->state) || /* data_conn_refuse */ + llc->p_flag)) { llc->failed_data_req = 1; goto out; } @@ -110,6 +104,7 @@ int llc_establish_connection(struct sock *sk, u8 *lmac, u8 *dmac, u8 dsap) ev->type = LLC_CONN_EV_TYPE_PRIM; ev->prim = LLC_CONN_PRIM; ev->prim_type = LLC_PRIM_TYPE_REQ; + skb_set_owner_w(skb, sk); rc = llc_conn_state_process(sk, skb); } out_put: @@ -144,6 +139,7 @@ int llc_send_disc(struct sock *sk) skb = alloc_skb(0, GFP_ATOMIC); if (!skb) goto out; + skb_set_owner_w(skb, sk); sk->sk_state = TCP_CLOSING; ev = llc_conn_ev(skb); ev->type = LLC_CONN_EV_TYPE_PRIM;