mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-04 03:33:58 +08:00
net: qualcomm: rmnet: Handle command packets with checksum trailer
When using the MAPv4 packet format in conjunction with MAP commands, a dummy DL checksum trailer will be appended to the packet. Before this packet is sent out as an ACK, the DL checksum trailer needs to be removed. Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
bbd21b247c
commit
23c76eb740
@ -58,11 +58,24 @@ static u8 rmnet_map_do_flow_control(struct sk_buff *skb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void rmnet_map_send_ack(struct sk_buff *skb,
|
static void rmnet_map_send_ack(struct sk_buff *skb,
|
||||||
unsigned char type)
|
unsigned char type,
|
||||||
|
struct rmnet_port *port)
|
||||||
{
|
{
|
||||||
struct rmnet_map_control_command *cmd;
|
struct rmnet_map_control_command *cmd;
|
||||||
int xmit_status;
|
int xmit_status;
|
||||||
|
|
||||||
|
if (port->data_format & RMNET_INGRESS_FORMAT_MAP_CKSUMV4) {
|
||||||
|
if (skb->len < sizeof(struct rmnet_map_header) +
|
||||||
|
RMNET_MAP_GET_LENGTH(skb) +
|
||||||
|
sizeof(struct rmnet_map_dl_csum_trailer)) {
|
||||||
|
kfree_skb(skb);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
skb_trim(skb, skb->len -
|
||||||
|
sizeof(struct rmnet_map_dl_csum_trailer));
|
||||||
|
}
|
||||||
|
|
||||||
skb->protocol = htons(ETH_P_MAP);
|
skb->protocol = htons(ETH_P_MAP);
|
||||||
|
|
||||||
cmd = RMNET_MAP_GET_CMD_START(skb);
|
cmd = RMNET_MAP_GET_CMD_START(skb);
|
||||||
@ -100,5 +113,5 @@ void rmnet_map_command(struct sk_buff *skb, struct rmnet_port *port)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (rc == RMNET_MAP_COMMAND_ACK)
|
if (rc == RMNET_MAP_COMMAND_ACK)
|
||||||
rmnet_map_send_ack(skb, rc);
|
rmnet_map_send_ack(skb, rc, port);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user