mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-15 06:27:21 +00:00
rxrpc: Extract useful fields from a received ACK to skb priv data
Extract useful fields from a received ACK packet into the skb private data early on in the process of parsing incoming packets. This makes the ACK fields available even before we've matched the ACK up to a call and will allow us to deal with path MTU discovery probe responses even after the relevant call has been completed. Signed-off-by: David Howells <dhowells@redhat.com> cc: Marc Dionne <marc.dionne@auristor.com> cc: "David S. Miller" <davem@davemloft.net> cc: Eric Dumazet <edumazet@google.com> cc: Jakub Kicinski <kuba@kernel.org> cc: Paolo Abeni <pabeni@redhat.com> cc: linux-afs@lists.infradead.org cc: netdev@vger.kernel.org
This commit is contained in:
@@ -124,6 +124,7 @@ static bool rxrpc_extract_header(struct rxrpc_skb_priv *sp,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
struct rxrpc_wire_header whdr;
|
||||
struct rxrpc_ackpacket ack;
|
||||
|
||||
/* dig out the RxRPC connection details */
|
||||
if (skb_copy_bits(skb, 0, &whdr, sizeof(whdr)) < 0)
|
||||
@@ -141,6 +142,16 @@ static bool rxrpc_extract_header(struct rxrpc_skb_priv *sp,
|
||||
sp->hdr.securityIndex = whdr.securityIndex;
|
||||
sp->hdr._rsvd = ntohs(whdr._rsvd);
|
||||
sp->hdr.serviceId = ntohs(whdr.serviceId);
|
||||
|
||||
if (sp->hdr.type == RXRPC_PACKET_TYPE_ACK) {
|
||||
if (skb_copy_bits(skb, sizeof(whdr), &ack, sizeof(ack)) < 0)
|
||||
return rxrpc_bad_message(skb, rxrpc_badmsg_short_ack);
|
||||
sp->ack.first_ack = ntohl(ack.firstPacket);
|
||||
sp->ack.prev_ack = ntohl(ack.previousPacket);
|
||||
sp->ack.acked_serial = ntohl(ack.serial);
|
||||
sp->ack.reason = ack.reason;
|
||||
sp->ack.nr_acks = ack.nAcks;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user