From: dlg Date: Wed, 10 Jan 2018 10:25:52 +0000 (+0000) Subject: simplify the input interface type check in carp_proto_input_if. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=88868b84dadc842f4cd57a028952fa06d5d0b77a;p=openbsd simplify the input interface type check in carp_proto_input_if. carp6_proto_input_if only handles packets "received" on real carp interfaces, which the ethernet stack goes to a lot of trouble to provide. since carp assumes ethernet, carp_proto_input_if can assume the packets will come in right too. ok mpi@ --- diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 1375cb5d2c0..63b5660ac14 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.321 2018/01/09 15:24:24 bluhm Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.322 2018/01/10 10:25:52 dlg Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -454,8 +454,7 @@ 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 || - (ifp->if_type != IFT_CARP && !ismulti && ifp->if_carp != NULL))) { + if (ifp->if_type != IFT_CARP) { carpstat_inc(carps_badif); CARP_LOG(LOG_INFO, sc, ("packet received on non-carp interface: %s",