Source-Changes-HG archive

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

[src/trunk]: src/sys/net use the CARP interface for arp/nd instead of the car...



details:   https://anonhg.NetBSD.org/src/rev/9bcd10245dd6
branches:  trunk
changeset: 1006462:9bcd10245dd6
user:      kardel <kardel%NetBSD.org@localhost>
date:      Thu Jan 16 13:16:59 2020 +0000

description:
use the CARP interface for arp/nd instead of the carp parent interface.
this provides the correct source mac address for the packets.

there are routers out there that cache the source mac during
nd and then subsequently bypass/miss packet filters on carp
interfaces as they send to the parent interface mac instead of the
correct carp interface mac.

diffstat:

 sys/net/if_ethersubr.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 75ad5f8c4554 -r 9bcd10245dd6 sys/net/if_ethersubr.c
--- a/sys/net/if_ethersubr.c    Thu Jan 16 13:15:47 2020 +0000
+++ b/sys/net/if_ethersubr.c    Thu Jan 16 13:16:59 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ethersubr.c,v 1.280 2019/10/16 18:29:49 christos Exp $      */
+/*     $NetBSD: if_ethersubr.c,v 1.281 2020/01/16 13:16:59 kardel Exp $        */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.280 2019/10/16 18:29:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.281 2020/01/16 13:16:59 kardel Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -243,7 +243,7 @@
                } else if (m->m_flags & M_MCAST) {
                        ETHER_MAP_IP_MULTICAST(&satocsin(dst)->sin_addr, edst);
                } else {
-                       error = arpresolve(ifp, rt, m, dst, edst, sizeof(edst));
+                       error = arpresolve(ifp0, rt, m, dst, edst, sizeof(edst));
                        if (error)
                                return (error == EWOULDBLOCK) ? 0 : error;
                }
@@ -292,7 +292,7 @@
                        ETHER_MAP_IPV6_MULTICAST(&satocsin6(dst)->sin6_addr,
                            edst);
                } else {
-                       error = nd6_resolve(ifp, rt, m, dst, edst,
+                       error = nd6_resolve(ifp0, rt, m, dst, edst,
                            sizeof(edst));
                        if (error)
                                return (error == EWOULDBLOCK) ? 0 : error;



Home | Main Index | Thread Index | Old Index