Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet6 Correct the check; we want to find IPPROTO_HOPO...



details:   https://anonhg.NetBSD.org/src/rev/615e1d4f0c3c
branches:  trunk
changeset: 359133:615e1d4f0c3c
user:      maxv <maxv%NetBSD.org@localhost>
date:      Wed Jan 31 15:23:08 2018 +0000

description:
Correct the check; we want to find IPPROTO_HOPOPTS, not IPV6_HOPOPTS. This
just couldn't work.

By the way, I'm wondering what is the point of this block. Calling
ip6_hopopts_input() won't achieve anything useful, and it could actually
be a problem, because there are several paths in it that call icmp6_error,
which calls ip6_output, and then we're back in the same function. Besides
it is possible to reach icmp6_error with a packet we emitted (as opposed
to a packet we are forwarding), and in that case we are sending an ICMP
error back to ourselves.

diffstat:

 sys/netinet6/ip6_output.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r b1a15c42c58d -r 615e1d4f0c3c sys/netinet6/ip6_output.c
--- a/sys/netinet6/ip6_output.c Wed Jan 31 14:16:28 2018 +0000
+++ b/sys/netinet6/ip6_output.c Wed Jan 31 15:23:08 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip6_output.c,v 1.199 2018/01/31 14:16:28 maxv Exp $    */
+/*     $NetBSD: ip6_output.c,v 1.200 2018/01/31 15:23:08 maxv Exp $    */
 /*     $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $    */
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.199 2018/01/31 14:16:28 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.200 2018/01/31 15:23:08 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -762,8 +762,10 @@
         * If the outgoing packet contains a hop-by-hop options header,
         * it must be examined and processed even by the source node.
         * (RFC 2460, section 4.)
+        *
+        * XXX Is this really necessary?
         */
-       if (ip6->ip6_nxt == IPV6_HOPOPTS) {
+       if (ip6->ip6_nxt == IPPROTO_HOPOPTS) {
                u_int32_t dummy1; /* XXX unused */
                u_int32_t dummy2; /* XXX unused */
                int hoff = sizeof(struct ip6_hdr);



Home | Main Index | Thread Index | Old Index