netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ipv6: ipv6_find_hdr restore prev functionality
@ 2014-02-27 11:57 Hans Schillstrom
  2014-02-27 23:28 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Hans Schillstrom @ 2014-02-27 11:57 UTC (permalink / raw)
  To: netdev, davem, ja, aatteka, kaber, ard, lvs-devel; +Cc: Hans Schillstrom

The commit 9195bb8e381d81d5a315f911904cdf0cfcc919b8 ("ipv6: improve 
ipv6_find_hdr() to skip empty routing headers") broke ipv6_find_hdr().

When a target is specified like IPPROTO_ICMPV6 ipv6_find_hdr()
returns -ENOENT when it's found, not the header as expected.

A part of IPVS is broken and possible also nft_exthdr_eval().
When target is -1 which it is most cases, it works.

This patch exits the do while loop if the specific header is found
so the nexthdr could be returned as expected.

Reported-by: Art -kwaak- van Breemen <ard@telegraafnet.nl>
Signed-off-by: Hans Schillstrom <hans@schillstrom.com>
CC:Ansis Atteka <aatteka@nicira.com>
---
 net/ipv6/exthdrs_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/exthdrs_core.c b/net/ipv6/exthdrs_core.c
index 140748d..8af3eb5 100644
--- a/net/ipv6/exthdrs_core.c
+++ b/net/ipv6/exthdrs_core.c
@@ -212,7 +212,7 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
 		found = (nexthdr == target);
 
 		if ((!ipv6_ext_hdr(nexthdr)) || nexthdr == NEXTHDR_NONE) {
-			if (target < 0)
+			if (target < 0 || found)
 				break;
 			return -ENOENT;
 		}
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] ipv6: ipv6_find_hdr restore prev functionality
  2014-02-27 11:57 [PATCH net] ipv6: ipv6_find_hdr restore prev functionality Hans Schillstrom
@ 2014-02-27 23:28 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-02-27 23:28 UTC (permalink / raw)
  To: hans; +Cc: netdev, ja, aatteka, kaber, ard, lvs-devel

From: Hans Schillstrom <hans@schillstrom.com>
Date: Thu, 27 Feb 2014 12:57:58 +0100

> The commit 9195bb8e381d81d5a315f911904cdf0cfcc919b8 ("ipv6: improve 
> ipv6_find_hdr() to skip empty routing headers") broke ipv6_find_hdr().
> 
> When a target is specified like IPPROTO_ICMPV6 ipv6_find_hdr()
> returns -ENOENT when it's found, not the header as expected.
> 
> A part of IPVS is broken and possible also nft_exthdr_eval().
> When target is -1 which it is most cases, it works.
> 
> This patch exits the do while loop if the specific header is found
> so the nexthdr could be returned as expected.
> 
> Reported-by: Art -kwaak- van Breemen <ard@telegraafnet.nl>
> Signed-off-by: Hans Schillstrom <hans@schillstrom.com>
> CC:Ansis Atteka <aatteka@nicira.com>

Looks good, applied and queued up for -stable, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-27 23:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-27 11:57 [PATCH net] ipv6: ipv6_find_hdr restore prev functionality Hans Schillstrom
2014-02-27 23:28 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).