Re: receive interfacez for carp when real mac is used

2020-07-22 Thread YASUOKA Masahiko
The problem I was to fix had been fixed by dlg@'s commit today.

  https://marc.info/?l=openbsd-cvs=159538265604770=2

So the diff is not needed any more.  Pointed out by dlg@.

Thanks,

On Wed, 22 Jul 2020 19:24:32 +0900 (JST)
YASUOKA Masahiko  wrote:
> Hi,
> 
> Currently when using the real mac address for carp(4) interface, all
> packets are treated as their receive inteface is carp.  This causes
> some problems.
> 
> For example, IPv6 ndp doesn't work on an interface which is used for
> carpdev.  Because it is assumed that reply packets are received with
> the same interface which is used to send out the request.
> 
> ok?
> 
> When realmac is used for carp(4), don't pass the packets through the
> interface since they are for the real interface.
> 
> Index: sys/netinet/ip_carp.c
> ===
> RCS file: /disk/cvs/openbsd/src/sys/netinet/ip_carp.c,v
> retrieving revision 1.345
> diff -u -p -r1.345 ip_carp.c
> --- sys/netinet/ip_carp.c 21 May 2020 05:24:59 -  1.345
> +++ sys/netinet/ip_carp.c 22 Jul 2020 09:52:20 -
> @@ -1418,6 +1418,14 @@ carp_input(struct ifnet *ifp0, struct mb
>   }
>   m_tag_prepend(m, mtag);
>   }
> +
> + /*
> +  * When carp is using realmac, since the matched MAC
> +  * address is for the real interface, the packets are
> +  * not for the carp interface.
> +  */
> + if (sc->sc_realmac)
> + sc = NULL;
>   break;
>   }
>   }
> 



receive interfacez for carp when real mac is used

2020-07-22 Thread YASUOKA Masahiko
Hi,

Currently when using the real mac address for carp(4) interface, all
packets are treated as their receive inteface is carp.  This causes
some problems.

For example, IPv6 ndp doesn't work on an interface which is used for
carpdev.  Because it is assumed that reply packets are received with
the same interface which is used to send out the request.

ok?

When realmac is used for carp(4), don't pass the packets through the
interface since they are for the real interface.

Index: sys/netinet/ip_carp.c
===
RCS file: /disk/cvs/openbsd/src/sys/netinet/ip_carp.c,v
retrieving revision 1.345
diff -u -p -r1.345 ip_carp.c
--- sys/netinet/ip_carp.c   21 May 2020 05:24:59 -  1.345
+++ sys/netinet/ip_carp.c   22 Jul 2020 09:52:20 -
@@ -1418,6 +1418,14 @@ carp_input(struct ifnet *ifp0, struct mb
}
m_tag_prepend(m, mtag);
}
+
+   /*
+* When carp is using realmac, since the matched MAC
+* address is for the real interface, the packets are
+* not for the carp interface.
+*/
+   if (sc->sc_realmac)
+   sc = NULL;
break;
}
}