packet : remove init_net restriction
[safe/jmp/linux-2.6] / net / rxrpc / ar-error.c
index f5539e2..d4d1ae2 100644 (file)
@@ -49,8 +49,7 @@ void rxrpc_UDP_error_report(struct sock *sk)
        addr = *(__be32 *)(skb_network_header(skb) + serr->addr_offset);
        port = serr->port;
 
-       _net("Rx UDP Error from "NIPQUAD_FMT":%hu",
-            NIPQUAD(addr), ntohs(port));
+       _net("Rx UDP Error from %pI4:%hu", &addr, ntohs(port));
        _debug("Msg l:%d d:%d", skb->len, skb->data_len);
 
        peer = rxrpc_find_peer(local, addr, port);
@@ -100,8 +99,10 @@ void rxrpc_UDP_error_report(struct sock *sk)
                }
 
                if (mtu < peer->mtu) {
+                       spin_lock_bh(&peer->lock);
                        peer->mtu = mtu;
                        peer->maxdata = peer->mtu - peer->hdrsize;
+                       spin_unlock_bh(&peer->lock);
                        _net("Net MTU %u (maxdata %u)",
                             peer->mtu, peer->maxdata);
                }
@@ -111,7 +112,7 @@ void rxrpc_UDP_error_report(struct sock *sk)
 
        /* pass the transport ref to error_handler to release */
        skb_queue_tail(&trans->error_queue, skb);
-       schedule_work(&trans->error_handler);
+       rxrpc_queue_work(&trans->error_handler);
 
        /* reset and regenerate socket error */
        spin_lock_bh(&sk->sk_error_queue.lock);
@@ -235,7 +236,7 @@ void rxrpc_UDP_error_handler(struct work_struct *work)
                            call->state < RXRPC_CALL_NETWORK_ERROR) {
                                call->state = RXRPC_CALL_NETWORK_ERROR;
                                set_bit(RXRPC_CALL_RCVD_ERROR, &call->events);
-                               schedule_work(&call->processor);
+                               rxrpc_queue_call(call);
                        }
                        write_unlock(&call->state_lock);
                        list_del_init(&call->error_link);
@@ -245,7 +246,7 @@ void rxrpc_UDP_error_handler(struct work_struct *work)
        }
 
        if (!skb_queue_empty(&trans->error_queue))
-               schedule_work(&trans->error_handler);
+               rxrpc_queue_work(&trans->error_handler);
 
        rxrpc_free_skb(skb);
        rxrpc_put_transport(trans);