Date: Sun, 21 Jul 2019 00:44:52 +0000 (UTC) From: Cy Schubert <cy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350188 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet Message-ID: <201907210044.x6L0iq7q046667@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cy Date: Sun Jul 21 00:44:52 2019 New Revision: 350188 URL: https://svnweb.freebsd.org/changeset/base/350188 Log: MFC r349979: Recycle the unused FR_CMPSIZ macro which became orphaned in ipfilter 5 prior to its import into FreeBSD. This macro calculates the size to be compared within the frentry structure. The ipfilter 4 version of the macro calculated the compare size based upon the static size of the frentry struct. Today it uses the ipfilter 5 method of calculating the size based upon the new to ipfilter 5 fr_size value found in the frentry struct itself. No effective change in code is intended. Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/fil.c Sat Jul 20 21:39:32 2019 (r350187) +++ stable/11/sys/contrib/ipfilter/netinet/fil.c Sun Jul 21 00:44:52 2019 (r350188) @@ -4436,8 +4436,8 @@ ipf_rule_compare(frentry_t *fr1, frentry_t *fr2) return (2); if (fr1->fr_dsize != fr2->fr_dsize) return (3); - if (bcmp((char *)&fr1->fr_func, (char *)&fr2->fr_func, - fr1->fr_size - offsetof(struct frentry, fr_func)) != 0) + if (bcmp((char *)&fr1->fr_func, (char *)&fr2->fr_func, FR_CMPSIZ(fr1)) + != 0) return (4); if (fr1->fr_data && !fr2->fr_data) return (5); Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Sat Jul 20 21:39:32 2019 (r350187) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Sun Jul 21 00:44:52 2019 (r350188) @@ -827,7 +827,7 @@ typedef struct frentry { #define FR_NOLOGTAG 0 -#define FR_CMPSIZ (sizeof(struct frentry) - \ +#define FR_CMPSIZ(_f) ((_f)->fr_size - \ offsetof(struct frentry, fr_func)) #define FR_NAME(_f, _n) (_f)->fr_names + (_f)->_n
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907210044.x6L0iq7q046667>