mlx5en: eliminate magic constant

Use sizeof(struct udphdr) where appropriate

Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2021-04-06 06:30:09 +03:00 committed by Konstantin Belousov
parent 16816f9689
commit 1b36b3869f

View File

@ -277,7 +277,7 @@ mlx5e_get_full_header_size(const struct mbuf *mb, const struct tcphdr **ppth)
goto tcp_packet;
case IPPROTO_UDP:
ip_hlen = ip->ip_hl << 2;
eth_hdr_len += ip_hlen + 8;
eth_hdr_len += ip_hlen + sizeof(struct udphdr);
th = NULL;
goto udp_packet;
default:
@ -293,7 +293,7 @@ mlx5e_get_full_header_size(const struct mbuf *mb, const struct tcphdr **ppth)
eth_hdr_len += sizeof(*ip6);
goto tcp_packet;
case IPPROTO_UDP:
eth_hdr_len += sizeof(*ip6) + 8;
eth_hdr_len += sizeof(*ip6) + sizeof(struct udphdr);
th = NULL;
goto udp_packet;
default: