···185185 * - max 48 bytes (struct sk_buff::cb)186186 */187187struct rxrpc_skb_priv {188188- union {189189- u8 nr_jumbo; /* Number of jumbo subpackets */190190- };188188+ u8 nr_subpackets; /* Number of subpackets */189189+ u8 rx_flags; /* Received packet flags */190190+#define RXRPC_SKB_INCL_LAST 0x01 /* - Includes last packet */191191 union {192192 int remain; /* amount of space remaining for next write */193193+194194+ /* List of requested ACKs on subpackets */195195+ unsigned long rx_req_ack[(RXRPC_MAX_NR_JUMBO + BITS_PER_LONG - 1) /196196+ BITS_PER_LONG];193197 };194198195199 struct rxrpc_host_header hdr; /* RxRPC packet header from this packet */
+14-9
net/rxrpc/input.c
···347347}348348349349/*350350- * Scan a jumbo packet to validate its structure and to work out how many350350+ * Scan a data packet to validate its structure and to work out how many351351 * subpackets it contains.352352 *353353 * A jumbo packet is a collection of consecutive packets glued together with···358358 * the last are RXRPC_JUMBO_DATALEN in size. The last subpacket may be of any359359 * size.360360 */361361-static bool rxrpc_validate_jumbo(struct sk_buff *skb)361361+static bool rxrpc_validate_data(struct sk_buff *skb)362362{363363 struct rxrpc_skb_priv *sp = rxrpc_skb(skb);364364 unsigned int offset = sizeof(struct rxrpc_wire_header);365365 unsigned int len = skb->len;366366- int nr_jumbo = 1;367366 u8 flags = sp->hdr.flags;368367369369- do {370370- nr_jumbo++;368368+ for (;;) {369369+ if (flags & RXRPC_REQUEST_ACK)370370+ __set_bit(sp->nr_subpackets, sp->rx_req_ack);371371+ sp->nr_subpackets++;372372+373373+ if (!(flags & RXRPC_JUMBO_PACKET))374374+ break;375375+371376 if (len - offset < RXRPC_JUMBO_SUBPKTLEN)372377 goto protocol_error;373378 if (flags & RXRPC_LAST_PACKET)···381376 if (skb_copy_bits(skb, offset, &flags, 1) < 0)382377 goto protocol_error;383378 offset += sizeof(struct rxrpc_jumbo_header);384384- } while (flags & RXRPC_JUMBO_PACKET);379379+ }385380386386- sp->nr_jumbo = nr_jumbo;381381+ if (flags & RXRPC_LAST_PACKET)382382+ sp->rx_flags |= RXRPC_SKB_INCL_LAST;387383 return true;388384389385protocol_error:···12431237 if (sp->hdr.callNumber == 0 ||12441238 sp->hdr.seq == 0)12451239 goto bad_message;12461246- if (sp->hdr.flags & RXRPC_JUMBO_PACKET &&12471247- !rxrpc_validate_jumbo(skb))12401240+ if (!rxrpc_validate_data(skb))12481241 goto bad_message;12491242 break;12501243
+9
net/rxrpc/protocol.h
···8989#define RXRPC_JUMBO_DATALEN 1412 /* non-terminal jumbo packet data length */9090#define RXRPC_JUMBO_SUBPKTLEN (RXRPC_JUMBO_DATALEN + sizeof(struct rxrpc_jumbo_header))91919292+/*9393+ * The maximum number of subpackets that can possibly fit in a UDP packet is:9494+ *9595+ * ((max_IP - IP_hdr - UDP_hdr) / RXRPC_JUMBO_SUBPKTLEN) + 19696+ * = ((65535 - 28 - 28) / 1416) + 19797+ * = 46 non-terminal packets and 1 terminal packet.9898+ */9999+#define RXRPC_MAX_NR_JUMBO 47100100+92101/*****************************************************************************/93102/*94103 * on-the-wire Rx ACK packet data payload