[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 3/6] net/eth: Initialize input_size variable earlier
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v4 3/6] net/eth: Initialize input_size variable earlier |
Date: |
Tue, 9 Mar 2021 19:27:06 +0100 |
Initialize the 'input_size' variable earlier to make the
next commit easier to review.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
net/eth.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/eth.c b/net/eth.c
index 6a5a1d04e0b..77af2b673bb 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -405,11 +405,10 @@ _eth_get_rss_ex_dst_addr(const struct iovec *pkt, int
pkt_frags,
struct ip6_ext_hdr *ext_hdr,
struct in6_address *dst_addr)
{
+ size_t input_size = iov_size(pkt, pkt_frags);
struct ip6_ext_hdr_routing *rthdr = (struct ip6_ext_hdr_routing *) ext_hdr;
if ((rthdr->rtype == 2) && (rthdr->segleft == 1)) {
-
- size_t input_size = iov_size(pkt, pkt_frags);
size_t bytes_read;
if (input_size < ext_hdr_offset + sizeof(*ext_hdr)) {
--
2.26.2
- [PATCH v4 0/6] net/eth: Fix stack-buffer-overflow in _eth_get_rss_ex_dst_addr(), Philippe Mathieu-Daudé, 2021/03/09
- [PATCH v4 1/6] net/eth: Simplify _eth_get_rss_ex_dst_addr(), Philippe Mathieu-Daudé, 2021/03/09
- [PATCH v4 2/6] net/eth: Better describe _eth_get_rss_ex_dst_addr's offset argument, Philippe Mathieu-Daudé, 2021/03/09
- [PATCH v4 3/6] net/eth: Initialize input_size variable earlier,
Philippe Mathieu-Daudé <=
- [PATCH v4 4/6] net/eth: Check rt_hdr size before casting to ip6_ext_hdr, Philippe Mathieu-Daudé, 2021/03/09
- [PATCH v4 5/6] net/eth: Remove now useless size check, Philippe Mathieu-Daudé, 2021/03/09
- [PATCH v4 6/6] net/eth: Return earlier in _eth_get_rss_ex_dst_addr(), Philippe Mathieu-Daudé, 2021/03/09