提交 16da0904 编写于 作者: M Michal Kalderon 提交者: David S. Miller

qed: Fix non TCP packets should be dropped on iWARP ll2 connection

FW workaround. The iWARP LL2 connection did not expect TCP packets
to arrive on it's connection. The fix drops any non-tcp packets

Fixes b5c29ca7 ("qed: iWARP CM - setup a ll2 connection for handling
SYN packets")
Signed-off-by: NMichal Kalderon <Michal.Kalderon@cavium.com>
Signed-off-by: NAriel Elior <Ariel.Elior@cavium.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 933e8c91
......@@ -1703,6 +1703,13 @@ qed_iwarp_parse_rx_pkt(struct qed_hwfn *p_hwfn,
iph = (struct iphdr *)((u8 *)(ethh) + eth_hlen);
if (eth_type == ETH_P_IP) {
if (iph->protocol != IPPROTO_TCP) {
DP_NOTICE(p_hwfn,
"Unexpected ip protocol on ll2 %x\n",
iph->protocol);
return -EINVAL;
}
cm_info->local_ip[0] = ntohl(iph->daddr);
cm_info->remote_ip[0] = ntohl(iph->saddr);
cm_info->ip_version = TCP_IPV4;
......@@ -1711,6 +1718,14 @@ qed_iwarp_parse_rx_pkt(struct qed_hwfn *p_hwfn,
*payload_len = ntohs(iph->tot_len) - ip_hlen;
} else if (eth_type == ETH_P_IPV6) {
ip6h = (struct ipv6hdr *)iph;
if (ip6h->nexthdr != IPPROTO_TCP) {
DP_NOTICE(p_hwfn,
"Unexpected ip protocol on ll2 %x\n",
iph->protocol);
return -EINVAL;
}
for (i = 0; i < 4; i++) {
cm_info->local_ip[i] =
ntohl(ip6h->daddr.in6_u.u6_addr32[i]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册