summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_carp.c
diff options
context:
space:
mode:
authoryasuoka <yasuoka@openbsd.org>2016-10-25 07:21:02 +0000
committeryasuoka <yasuoka@openbsd.org>2016-10-25 07:21:02 +0000
commitf86db09137e7d87e8654c15d693cd24221d43b97 (patch)
treefc48d42029713c92bea76da97151eaca5a0b8f3b /sys/netinet/ip_carp.c
parentDeduplicate the CRS parsing code and handle broken ACPI implementations. (diff)
downloadwireguard-openbsd-f86db09137e7d87e8654c15d693cd24221d43b97.tar.xz
wireguard-openbsd-f86db09137e7d87e8654c15d693cd24221d43b97.zip
Accept CARP advertisement packets whose destination is not for multicast.
When both "carppeer" and "real mac-address" are used at once and the BACKUP is to take over the new MASTER, the present MASTER receives such packets. Found by and diff from nagasaka at iij. ok henning bluhm
Diffstat (limited to 'sys/netinet/ip_carp.c')
-rw-r--r--sys/netinet/ip_carp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 9eb5552cbb5..ff3ae78600d 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.294 2016/10/04 13:54:32 mpi Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.295 2016/10/25 07:21:02 yasuoka Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -453,7 +453,7 @@ carp_proto_input_if(struct ifnet *ifp, struct mbuf *m, int hlen)
ismulti = IN_MULTICAST(ip->ip_dst.s_addr);
/* check if received on a valid carp interface */
- if (!((ifp->if_type == IFT_CARP && ismulti) ||
+ if (!(ifp->if_type == IFT_CARP ||
(ifp->if_type != IFT_CARP && !ismulti && ifp->if_carp != NULL))) {
carpstats.carps_badif++;
CARP_LOG(LOG_INFO, sc,