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:
parent
16816f9689
commit
1b36b3869f
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user