Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Jan 2019 09:54:28 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r343141 - stable/12/sys/netpfil/ipfw
Message-ID:  <201901180954.x0I9sSSZ070637@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Fri Jan 18 09:54:28 2019
New Revision: 343141
URL: https://svnweb.freebsd.org/changeset/base/343141

Log:
  MFC r342925:
    Relax requirement to packet size of CARP protocol and remove version check.
  
    CARP shares protocol number 112 with VRRP (RFC 5798). And the size of
    VRRP packet may be smaller than CARP. ipfw_chk() does m_pullup() to at
    least sizeof(struct carp_header) and can fail when packet is VRRP. This
    leads to packet drop and message about failed pullup attempt.
    Also, RFC 5798 defines version 3 of VRRP protocol, this version number
    also unsupported by CARP and such check leads to packet drop.
  
    carp_input() does its own checks for protocol version and packet size,
    so we can remove these checks to be able pass VRRP packets.
  
    PR:		234207

Modified:
  stable/12/sys/netpfil/ipfw/ip_fw2.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netpfil/ipfw/ip_fw2.c
==============================================================================
--- stable/12/sys/netpfil/ipfw/ip_fw2.c	Fri Jan 18 09:41:17 2019	(r343140)
+++ stable/12/sys/netpfil/ipfw/ip_fw2.c	Fri Jan 18 09:54:28 2019	(r343141)
@@ -1597,12 +1597,10 @@ do {								\
 				break;
 
 			case IPPROTO_CARP:
-				PULLUP_TO(hlen, ulp, struct carp_header);
-				if (((struct carp_header *)ulp)->carp_version !=
-				    CARP_VERSION) 
-					return (IP_FW_DENY);
-				if (((struct carp_header *)ulp)->carp_type !=
-				    CARP_ADVERTISEMENT) 
+				PULLUP_TO(hlen, ulp, offsetof(
+				    struct carp_header, carp_counter));
+				if (CARP_ADVERTISEMENT !=
+				    ((struct carp_header *)ulp)->carp_type)
 					return (IP_FW_DENY);
 				break;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901180954.x0I9sSSZ070637>