소스 검색

NFC: llcp: Remove the tx backlog queue

Not only it was improperly use to queue backlogged RX skbuffs, but it was
also not processed at all.
If the socket receive queue is full we simply drop the incoming packets.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Samuel Ortiz 13 년 전
부모
커밋
2593c2c6ec
3개의 변경된 파일2개의 추가작업 그리고 6개의 파일을 삭제
  1. 2 3
      net/nfc/llcp/llcp.c
  2. 0 1
      net/nfc/llcp/llcp.h
  3. 0 2
      net/nfc/llcp/sock.c

+ 2 - 3
net/nfc/llcp/llcp.c

@@ -54,7 +54,6 @@ static void nfc_llcp_socket_purge(struct nfc_llcp_sock *sock)
 
 	skb_queue_purge(&sock->tx_queue);
 	skb_queue_purge(&sock->tx_pending_queue);
-	skb_queue_purge(&sock->tx_backlog_queue);
 
 	if (local == NULL)
 		return;
@@ -785,7 +784,7 @@ static void nfc_llcp_recv_ui(struct nfc_llcp_local *local,
 	skb_pull(skb, LLCP_HEADER_SIZE);
 	if (sock_queue_rcv_skb(&llcp_sock->sk, skb)) {
 		pr_err("receive queue is full\n");
-		skb_queue_head(&llcp_sock->tx_backlog_queue, skb);
+		kfree_skb(skb);
 	}
 
 	nfc_llcp_sock_put(llcp_sock);
@@ -980,7 +979,7 @@ static void nfc_llcp_recv_hdlc(struct nfc_llcp_local *local,
 		skb_pull(skb, LLCP_HEADER_SIZE + LLCP_SEQUENCE_SIZE);
 		if (sock_queue_rcv_skb(&llcp_sock->sk, skb)) {
 			pr_err("receive queue is full\n");
-			skb_queue_head(&llcp_sock->tx_backlog_queue, skb);
+			kfree_skb(skb);
 		}
 	}
 

+ 0 - 1
net/nfc/llcp/llcp.h

@@ -121,7 +121,6 @@ struct nfc_llcp_sock {
 
 	struct sk_buff_head tx_queue;
 	struct sk_buff_head tx_pending_queue;
-	struct sk_buff_head tx_backlog_queue;
 
 	struct list_head accept_queue;
 	struct sock *parent;

+ 0 - 2
net/nfc/llcp/sock.c

@@ -808,7 +808,6 @@ struct sock *nfc_llcp_sock_alloc(struct socket *sock, int type, gfp_t gfp)
 	llcp_sock->reserved_ssap = LLCP_SAP_MAX;
 	skb_queue_head_init(&llcp_sock->tx_queue);
 	skb_queue_head_init(&llcp_sock->tx_pending_queue);
-	skb_queue_head_init(&llcp_sock->tx_backlog_queue);
 	INIT_LIST_HEAD(&llcp_sock->accept_queue);
 
 	if (sock != NULL)
@@ -823,7 +822,6 @@ void nfc_llcp_sock_free(struct nfc_llcp_sock *sock)
 
 	skb_queue_purge(&sock->tx_queue);
 	skb_queue_purge(&sock->tx_pending_queue);
-	skb_queue_purge(&sock->tx_backlog_queue);
 
 	list_del_init(&sock->accept_queue);