Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/ipf/netinet From Edgar Fuss:



details:   https://anonhg.NetBSD.org/src/rev/67997a79750f
branches:  trunk
changeset: 355275:67997a79750f
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jul 23 06:12:02 2017 +0000

description:
>From Edgar Fuss:
ipf's return-icmp doesn't work when the packet matched by the rule is
directed at a link local address. The problem is that
ipf_send_icmp_err() calls ipf_ifpaddr() to find an address of the
interface in question, but that routine discards link local addresses.
I guess the best fix is to simply use the destination address instead if
it is link local, i.e. treat the rule as if return-icmp-as-dest was
given in this case.

diffstat:

 sys/external/bsd/ipf/netinet/ip_fil_netbsd.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r e5e9daf13020 -r 67997a79750f sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
--- a/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c      Sun Jul 23 05:40:27 2017 +0000
+++ b/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c      Sun Jul 23 06:12:02 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_fil_netbsd.c,v 1.24 2017/07/20 18:12:51 christos Exp $      */
+/*     $NetBSD: ip_fil_netbsd.c,v 1.25 2017/07/23 06:12:02 christos Exp $      */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -8,7 +8,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.24 2017/07/20 18:12:51 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.25 2017/07/23 06:12:02 christos Exp $");
 #else
 static const char sccsid[] = "@(#)ip_fil.c     2.41 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 1.1.1.2 2012/07/22 13:45:17 darrenr Exp";
@@ -987,7 +987,7 @@
                }
                xtra = MIN(fin->fin_plen, avail - iclen - max_linkhdr);
                xtra = MIN(xtra, IPV6_MMTU - iclen);
-               if (dst == 0) {
+               if (dst == 0 && !IN6_IS_ADDR_LINKLOCAL(&fin->fin_dst6.in6)) {
                        if (ipf_ifpaddr(&ipfmain, 6, FRI_NORMAL, ifp,
                                       &dst6, NULL) == -1) {
                                FREE_MB_T(m);



Home | Main Index | Thread Index | Old Index