From 2f700a37c38bdbf39d405647f3fa151ba9e9d0fc Mon Sep 17 00:00:00 2001 From: dlg Date: Fri, 12 Jan 2018 23:29:37 +0000 Subject: [PATCH] unbreak configurations using carppeers ip_carp.c r1.322 removed the ability to receive carp protocol packets on !IFT_CARP interfaces. however, carppeers cause the carp protocol packets to be directed to a unicast address on another interface, which definitely is not mapped back to a carp interface. this brings back the ability to get carp packets on parent interfaces. it is a bit different to a backout because it only allows carp parents to be ethernet interfaces. mpi@ told me carp regress tests were failing. --- sys/netinet/ip_carp.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 0faae326d2f..bb9fa4220bd 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.325 2018/01/12 00:36:13 dlg Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.326 2018/01/12 23:29:37 dlg Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -450,7 +450,14 @@ carp_proto_input_if(struct ifnet *ifp, struct mbuf **mp, int *offp, int proto) ismulti = IN_MULTICAST(ip->ip_dst.s_addr); /* check if received on a valid carp interface */ - if (ifp->if_type != IFT_CARP) { + switch (ifp->if_type) { + case IFT_CARP: + break; + case IFT_ETHER: + if (ismulti || !SRPL_EMPTY_LOCKED(&ifp->if_carp)) + break; + /* FALLTHROUGH */ + default: carpstat_inc(carps_badif); CARP_LOG(LOG_INFO, sc, ("packet received on non-carp interface: %s", -- 2.20.1