Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1485645

[PATCH net-next 02/14] rxrpc: Move the check of rx_pkt_offset from rxrpc_locate_data() to caller

From David Howells <dhowells@redhat.com>
Newsgroups linux.kernel
Subject [PATCH net-next 02/14] rxrpc: Move the check of rx_pkt_offset from rxrpc_locate_data() to caller
Date 2016-09-18 01:30 +0200
Message-ID <sixdx-qm-41@gated-at.bofh.it> (permalink)
References <six3P-mU-3@gated-at.bofh.it>
Organization Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903

Show all headers | View raw


Move the check of rx_pkt_offset from rxrpc_locate_data() to the caller,
rxrpc_recvmsg_data(), so that it's more clear what's going on there.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 net/rxrpc/recvmsg.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/net/rxrpc/recvmsg.c b/net/rxrpc/recvmsg.c
index a284205b8ecf..0d085f5cf1bf 100644
--- a/net/rxrpc/recvmsg.c
+++ b/net/rxrpc/recvmsg.c
@@ -240,9 +240,6 @@ static int rxrpc_locate_data(struct rxrpc_call *call, struct sk_buff *skb,
 	int ret;
 	u8 annotation = *_annotation;
 
-	if (offset > 0)
-		return 0;
-
 	/* Locate the subpacket */
 	offset = sp->offset;
 	len = skb->len - sp->offset;
@@ -303,8 +300,10 @@ static int rxrpc_recvmsg_data(struct socket *sock, struct rxrpc_call *call,
 		if (msg)
 			sock_recv_timestamp(msg, sock->sk, skb);
 
-		ret = rxrpc_locate_data(call, skb, &call->rxtx_annotations[ix],
-					&rx_pkt_offset, &rx_pkt_len);
+		if (rx_pkt_offset == 0)
+			ret = rxrpc_locate_data(call, skb,
+						&call->rxtx_annotations[ix],
+						&rx_pkt_offset, &rx_pkt_len);
 		_debug("recvmsg %x DATA #%u { %d, %d }",
 		       sp->hdr.callNumber, seq, rx_pkt_offset, rx_pkt_len);
 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 00/14] rxrpc: Fixes & miscellany David Howells <dhowells@redhat.com> - 2016-09-18 01:20 +0200
  [PATCH net-next 09/14] rxrpc: Fix unexposed client conn release David Howells <dhowells@redhat.com> - 2016-09-18 01:20 +0200
  [PATCH net-next 12/14] rxrpc: Don't transmit an ACK if there's no  reason set David Howells <dhowells@redhat.com> - 2016-09-18 01:20 +0200
  [PATCH net-next 07/14] rxrpc: Fix the putting of client connections David Howells <dhowells@redhat.com> - 2016-09-18 01:20 +0200
  [PATCH net-next 14/14] rxrpc: Fix the basic transmit DATA packet  content size at 1412 bytes David Howells <dhowells@redhat.com> - 2016-09-18 01:20 +0200
  [PATCH net-next 06/14] rxrpc: Purge the to_be_accepted queue on  socket release David Howells <dhowells@redhat.com> - 2016-09-18 01:20 +0200
  [PATCH net-next 01/14] rxrpc: Remove some whitespace. David Howells <dhowells@redhat.com> - 2016-09-18 01:20 +0200
  [PATCH net-next 03/14] rxrpc: Check the return value of  rxrpc_locate_data() David Howells <dhowells@redhat.com> - 2016-09-18 01:20 +0200
  [PATCH net-next 11/14] rxrpc: Fix retransmission algorithm David Howells <dhowells@redhat.com> - 2016-09-18 01:30 +0200
  [PATCH net-next 05/14] rxrpc: Record calls that need to be accepted David Howells <dhowells@redhat.com> - 2016-09-18 01:30 +0200
  [PATCH net-next 13/14] rxrpc: Be consistent about switch value in  rxrpc_send_call_packet() David Howells <dhowells@redhat.com> - 2016-09-18 01:30 +0200
  [PATCH net-next 02/14] rxrpc: Move the check of rx_pkt_offset from  rxrpc_locate_data() to caller David Howells <dhowells@redhat.com> - 2016-09-18 01:30 +0200
  [PATCH net-next 10/14] rxrpc: Fix the parsing of soft-ACKs David Howells <dhowells@redhat.com> - 2016-09-18 01:30 +0200
  Re: [PATCH net-next 00/14] rxrpc: Fixes & miscellany David Miller <davem@davemloft.net> - 2016-09-18 13:30 +0200
  Re: [PATCH net-next 00/14] rxrpc: Fixes & miscellany David Miller <davem@davemloft.net> - 2016-09-19 08:00 +0200

csiph-web