From nobody Mon Feb 07 13:51:55 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EB4E119AA4D5; Mon, 7 Feb 2022 13:51:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jsncr4k6hz4y4R; Mon, 7 Feb 2022 13:51:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644241917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mlD6NPtQ2jL4rYbrNhgz2AxkGNd+GPWahNDys1tOchs=; b=EVa7K5gj6m9rANKcXu7gp7PnbtyRLqcd9PlrgEeGQNZuT+4jMRXfukvzLXq3yXqP3AxB/u ZyD4O931VDpEtGCJOiGh8BaOHVMReSHfq9qJ6V2Xyd28KeCEDsHPcj0DVoYLuKgZwbW558 p0PJd1G3Tp2j1CoYuGnit3UDzhPcqhG3MQKek3O4k5r/YXofNe5Npo/x5HoWQFNWaNyyKq 8x0dsacIHQKCVBfxLAD1UlP6nfaUsEcQuJc2m9vZTtVh+ZNvAvRIww+BHfRjLywbLgx67+ 8Dr6sP4GO3veot2geUCWLBRGNsYwdDdHYDa6ObDuOOzD+NAqOzbUDuwqrURrzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A08362644E; Mon, 7 Feb 2022 13:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 217Dpt04079460; Mon, 7 Feb 2022 13:51:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 217Dpt3R079459; Mon, 7 Feb 2022 13:51:55 GMT (envelope-from git) Date: Mon, 7 Feb 2022 13:51:55 GMT Message-Id: <202202071351.217Dpt3R079459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: c95ef272f11d - stable/13 - ipfilter: INLINE --> inline List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c95ef272f11d872408d1143a6cf0df2722b358f1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644241917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mlD6NPtQ2jL4rYbrNhgz2AxkGNd+GPWahNDys1tOchs=; b=Lm02YyNh/lBvpOlRpvBrfTfZZARAswkYElqZEOY6d8fz3DjHv/CzN8kp+8itw/UcAHLXHE 95K1USfJC8jK7WRA82r2+1r9RaWDKL/wZZPgUFW+KLCYTeN2IwusMmXiVeNUhyuFpDbe1Z M5y4g3vgZ1YUOgXvur0rmWVS5vWQjm8RpW2QZQ8m/nbjTiO1YyuRBk/OsD6spSMC7YG429 C4iDeNmN1mGjy8Ec6whniRWRvD6+zoXE5t/+tpMB0XSDxVRXP8BxPSp2hr6bB/3wlZJdDW FZ+5rtELw3LWAuCfwe4bS/aOHBMyqjvIK4hA4xKV8geFegrqYyRdGFmNL9Lo/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644241917; a=rsa-sha256; cv=none; b=mYaRgeF9dRypYasJ/zp+27s8zkOtp6HhuimpOkAQSTks98grLbNILurpH+ulihWaJ1qTES Utn9zqXgEvT7HKq3wKsBSw3Tsxpp4h0fVH70cpVAlYFPJBP6phMykoC6cWMg19Kmasr8Eu B6X5XkDNvTuGYa090B6/RI/QoKEiw36L6X6mTkmCzJqGi9iHhgF0c32ofH/Htuf2lLyepN 4KSjf4I92JAscNDViazz9UNGPWQVsGYvtMhszfPIOU9H7SSxXQp/R9O+ohIpWt5TNj/OFo lpuxexVXAbMAFau0u8zrEZdYeIIzAPVtAu4sjvtohSRzIvmnoeRYCv4wPImwPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=c95ef272f11d872408d1143a6cf0df2722b358f1 commit c95ef272f11d872408d1143a6cf0df2722b358f1 Author: Cy Schubert AuthorDate: 2021-12-21 17:22:10 +0000 Commit: Cy Schubert CommitDate: 2022-02-07 13:51:15 +0000 ipfilter: INLINE --> inline Replace the INLINE macro with inline. Some ancient compilers supported __inline__ instead of inline. The INLINE hack compensated for it. Ancient compilers are history. Reported by: glebius (cherry picked from commit 9be9c1c084574e3d29f38019118a50f648d2f2a8) --- sbin/ipf/ipftest/ip_fil.c | 6 +- sys/netpfil/ipfilter/netinet/fil.c | 104 +++++++++++++------------- sys/netpfil/ipfilter/netinet/ip_compat.h | 8 -- sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 4 +- 4 files changed, 57 insertions(+), 65 deletions(-) diff --git a/sbin/ipf/ipftest/ip_fil.c b/sbin/ipf/ipftest/ip_fil.c index 327f90fc356c..4a0af7a33810 100644 --- a/sbin/ipf/ipftest/ip_fil.c +++ b/sbin/ipf/ipftest/ip_fil.c @@ -563,7 +563,7 @@ ipf_newisn(fin) /* */ /* Returns the next IPv4 ID to use for this packet. */ /* ------------------------------------------------------------------------ */ -INLINE u_short +inline u_short ipf_nextipid(fin) fr_info_t *fin; { @@ -586,7 +586,7 @@ ipf_nextipid(fin) } -INLINE int +inline int ipf_checkv4sum(fin) fr_info_t *fin; { @@ -603,7 +603,7 @@ ipf_checkv4sum(fin) #ifdef USE_INET6 -INLINE int +inline int ipf_checkv6sum(fin) fr_info_t *fin; { diff --git a/sys/netpfil/ipfilter/netinet/fil.c b/sys/netpfil/ipfilter/netinet/fil.c index da05c5405e39..282f056e17e8 100644 --- a/sys/netpfil/ipfilter/netinet/fil.c +++ b/sys/netpfil/ipfilter/netinet/fil.c @@ -120,7 +120,7 @@ extern int blockreason; #define LBUMP(x) softc->x++ #define LBUMPD(x, y) do { softc->x.y++; DT(y); } while (0) -static INLINE int ipf_check_ipf(fr_info_t *, frentry_t *, int); +static inline int ipf_check_ipf(fr_info_t *, frentry_t *, int); static u_32_t ipf_checkcipso(fr_info_t *, u_char *, int); static u_32_t ipf_checkripso(u_char *); static u_32_t ipf_decaps(fr_info_t *, u_32_t, int); @@ -152,16 +152,16 @@ static int ipf_grpmapinit(struct ipf_main_softc_s *, static frentry_t *ipf_nextrule(ipf_main_softc_t *, int, int, frentry_t *, int); static int ipf_portcheck(frpcmp_t *, u_32_t); -static INLINE int ipf_pr_ah(fr_info_t *); -static INLINE void ipf_pr_esp(fr_info_t *); -static INLINE void ipf_pr_gre(fr_info_t *); -static INLINE void ipf_pr_udp(fr_info_t *); -static INLINE void ipf_pr_tcp(fr_info_t *); -static INLINE void ipf_pr_icmp(fr_info_t *); -static INLINE void ipf_pr_ipv4hdr(fr_info_t *); -static INLINE void ipf_pr_short(fr_info_t *, int); -static INLINE int ipf_pr_tcpcommon(fr_info_t *); -static INLINE int ipf_pr_udpcommon(fr_info_t *); +static inline int ipf_pr_ah(fr_info_t *); +static inline void ipf_pr_esp(fr_info_t *); +static inline void ipf_pr_gre(fr_info_t *); +static inline void ipf_pr_udp(fr_info_t *); +static inline void ipf_pr_tcp(fr_info_t *); +static inline void ipf_pr_icmp(fr_info_t *); +static inline void ipf_pr_ipv4hdr(fr_info_t *); +static inline void ipf_pr_short(fr_info_t *, int); +static inline int ipf_pr_tcpcommon(fr_info_t *); +static inline int ipf_pr_udpcommon(fr_info_t *); static void ipf_rule_delete(ipf_main_softc_t *, frentry_t *f, int, int); static void ipf_rule_expire_insert(ipf_main_softc_t *, @@ -392,20 +392,20 @@ static ipftuneable_t ipf_main_tuneables[] = { * adding more code to a growing switch statement. */ #ifdef USE_INET6 -static INLINE int ipf_pr_ah6(fr_info_t *); -static INLINE void ipf_pr_esp6(fr_info_t *); -static INLINE void ipf_pr_gre6(fr_info_t *); -static INLINE void ipf_pr_udp6(fr_info_t *); -static INLINE void ipf_pr_tcp6(fr_info_t *); -static INLINE void ipf_pr_icmp6(fr_info_t *); -static INLINE void ipf_pr_ipv6hdr(fr_info_t *); -static INLINE void ipf_pr_short6(fr_info_t *, int); -static INLINE int ipf_pr_hopopts6(fr_info_t *); -static INLINE int ipf_pr_mobility6(fr_info_t *); -static INLINE int ipf_pr_routing6(fr_info_t *); -static INLINE int ipf_pr_dstopts6(fr_info_t *); -static INLINE int ipf_pr_fragment6(fr_info_t *); -static INLINE struct ip6_ext *ipf_pr_ipv6exthdr(fr_info_t *, int, int); +static inline int ipf_pr_ah6(fr_info_t *); +static inline void ipf_pr_esp6(fr_info_t *); +static inline void ipf_pr_gre6(fr_info_t *); +static inline void ipf_pr_udp6(fr_info_t *); +static inline void ipf_pr_tcp6(fr_info_t *); +static inline void ipf_pr_icmp6(fr_info_t *); +static inline void ipf_pr_ipv6hdr(fr_info_t *); +static inline void ipf_pr_short6(fr_info_t *, int); +static inline int ipf_pr_hopopts6(fr_info_t *); +static inline int ipf_pr_mobility6(fr_info_t *); +static inline int ipf_pr_routing6(fr_info_t *); +static inline int ipf_pr_dstopts6(fr_info_t *); +static inline int ipf_pr_fragment6(fr_info_t *); +static inline struct ip6_ext *ipf_pr_ipv6exthdr(fr_info_t *, int, int); /* ------------------------------------------------------------------------ */ @@ -419,7 +419,7 @@ static INLINE struct ip6_ext *ipf_pr_ipv6exthdr(fr_info_t *, int, int); /* for IPv6 and marks the packet with FI_SHORT if so. See function comment */ /* for ipf_pr_short() for more details. */ /* ------------------------------------------------------------------------ */ -static INLINE void +static inline void ipf_pr_short6(fr_info_t *fin, int xmin) { @@ -439,7 +439,7 @@ ipf_pr_short6(fr_info_t *fin, int xmin) /* analyzer may pullup or free the packet itself so we need to be vigiliant */ /* of that possibility arising. */ /* ------------------------------------------------------------------------ */ -static INLINE void +static inline void ipf_pr_ipv6hdr(fr_info_t *fin) { ip6_t *ip6 = (ip6_t *)fin->fin_ip; @@ -610,7 +610,7 @@ ipf_pr_ipv6hdr(fr_info_t *fin) /* big enough for it to be in, checking if it is repeated and setting a */ /* flag to indicate its presence. */ /* ------------------------------------------------------------------------ */ -static INLINE struct ip6_ext * +static inline struct ip6_ext * ipf_pr_ipv6exthdr(fr_info_t *fin, int multiple, int proto) { ipf_main_softc_t *softc = fin->fin_main_soft; @@ -687,7 +687,7 @@ ipf_pr_ipv6exthdr(fr_info_t *fin, int multiple, int proto) /* IPv6 Only */ /* This is function checks pending hop by hop options extension header */ /* ------------------------------------------------------------------------ */ -static INLINE int +static inline int ipf_pr_hopopts6(fr_info_t *fin) { struct ip6_ext *hdr; @@ -707,7 +707,7 @@ ipf_pr_hopopts6(fr_info_t *fin) /* IPv6 Only */ /* This is function checks the IPv6 mobility extension header */ /* ------------------------------------------------------------------------ */ -static INLINE int +static inline int ipf_pr_mobility6(fr_info_t *fin) { struct ip6_ext *hdr; @@ -727,7 +727,7 @@ ipf_pr_mobility6(fr_info_t *fin) /* IPv6 Only */ /* This is function checks pending routing extension header */ /* ------------------------------------------------------------------------ */ -static INLINE int +static inline int ipf_pr_routing6(fr_info_t *fin) { struct ip6_routing *hdr; @@ -790,7 +790,7 @@ ipf_pr_routing6(fr_info_t *fin) /* headers must always be in a packet that has the offset field set to 0 */ /* and no packet is allowed to overlay that where offset = 0. */ /* ------------------------------------------------------------------------ */ -static INLINE int +static inline int ipf_pr_fragment6(fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; @@ -848,7 +848,7 @@ ipf_pr_fragment6(fr_info_t *fin) /* IPv6 Only */ /* This is function checks pending destination options extension header */ /* ------------------------------------------------------------------------ */ -static INLINE int +static inline int ipf_pr_dstopts6(fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; @@ -872,7 +872,7 @@ ipf_pr_dstopts6(fr_info_t *fin) /* This routine is mainly concerned with determining the minimum valid size */ /* for an ICMPv6 packet. */ /* ------------------------------------------------------------------------ */ -static INLINE void +static inline void ipf_pr_icmp6(fr_info_t *fin) { int minicmpsz = sizeof(struct icmp6_hdr); @@ -959,7 +959,7 @@ ipf_pr_icmp6(fr_info_t *fin) /* Analyse the packet for IPv6/UDP properties. */ /* Is not expected to be called for fragmented packets. */ /* ------------------------------------------------------------------------ */ -static INLINE void +static inline void ipf_pr_udp6(fr_info_t *fin) { @@ -982,7 +982,7 @@ ipf_pr_udp6(fr_info_t *fin) /* Analyse the packet for IPv6/TCP properties. */ /* Is not expected to be called for fragmented packets. */ /* ------------------------------------------------------------------------ */ -static INLINE void +static inline void ipf_pr_tcp6(fr_info_t *fin) { @@ -1008,7 +1008,7 @@ ipf_pr_tcp6(fr_info_t *fin) /* is 32bits as well, it is not possible(?) to determine the version from a */ /* simple packet header. */ /* ------------------------------------------------------------------------ */ -static INLINE void +static inline void ipf_pr_esp6(fr_info_t *fin) { @@ -1031,7 +1031,7 @@ ipf_pr_esp6(fr_info_t *fin) /* The minimum length is taken to be the combination of all fields in the */ /* header being present and no authentication data (null algorithm used.) */ /* ------------------------------------------------------------------------ */ -static INLINE int +static inline int ipf_pr_ah6(fr_info_t *fin) { authhdr_t *ah; @@ -1063,7 +1063,7 @@ ipf_pr_ah6(fr_info_t *fin) /* */ /* Analyse the packet for GRE properties. */ /* ------------------------------------------------------------------------ */ -static INLINE void +static inline void ipf_pr_gre6(fr_info_t *fin) { grehdr_t *gre; @@ -1147,7 +1147,7 @@ ipf_pr_pullup(fr_info_t *fin, int plen) /* start within the layer 4 header (hdrmin) or if it is at offset 0, the */ /* entire layer 4 header must be present (min). */ /* ------------------------------------------------------------------------ */ -static INLINE void +static inline void ipf_pr_short(fr_info_t *fin, int xmin) { @@ -1173,7 +1173,7 @@ ipf_pr_short(fr_info_t *fin, int xmin) /* */ /* XXX - other ICMP sanity checks? */ /* ------------------------------------------------------------------------ */ -static INLINE void +static inline void ipf_pr_icmp(fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; @@ -1292,7 +1292,7 @@ ipf_pr_icmp(fr_info_t *fin) /* If compiled with IPFILTER_CKSUM, check to see if the TCP checksum is */ /* valid and mark the packet as bad if not. */ /* ------------------------------------------------------------------------ */ -static INLINE int +static inline int ipf_pr_tcpcommon(fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; @@ -1468,7 +1468,7 @@ ipf_pr_tcpcommon(fr_info_t *fin) /* Extract the UDP source and destination ports, if present. If compiled */ /* with IPFILTER_CKSUM, check to see if the UDP checksum is valid. */ /* ------------------------------------------------------------------------ */ -static INLINE int +static inline int ipf_pr_udpcommon(fr_info_t *fin) { udphdr_t *udp; @@ -1502,7 +1502,7 @@ ipf_pr_udpcommon(fr_info_t *fin) /* IPv4 Only */ /* Analyse the packet for IPv4/TCP properties. */ /* ------------------------------------------------------------------------ */ -static INLINE void +static inline void ipf_pr_tcp(fr_info_t *fin) { @@ -1521,7 +1521,7 @@ ipf_pr_tcp(fr_info_t *fin) /* IPv4 Only */ /* Analyse the packet for IPv4/UDP properties. */ /* ------------------------------------------------------------------------ */ -static INLINE void +static inline void ipf_pr_udp(fr_info_t *fin) { @@ -1543,7 +1543,7 @@ ipf_pr_udp(fr_info_t *fin) /* is 32bits as well, it is not possible(?) to determine the version from a */ /* simple packet header. */ /* ------------------------------------------------------------------------ */ -static INLINE void +static inline void ipf_pr_esp(fr_info_t *fin) { @@ -1567,7 +1567,7 @@ ipf_pr_esp(fr_info_t *fin) /* The minimum length is taken to be the combination of all fields in the */ /* header being present and no authentication data (null algorithm used.) */ /* ------------------------------------------------------------------------ */ -static INLINE int +static inline int ipf_pr_ah(fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; @@ -1615,7 +1615,7 @@ ipf_pr_ah(fr_info_t *fin) /* */ /* Analyse the packet for GRE properties. */ /* ------------------------------------------------------------------------ */ -static INLINE void +static inline void ipf_pr_gre(fr_info_t *fin) { ipf_main_softc_t *softc = fin->fin_main_soft; @@ -1648,7 +1648,7 @@ ipf_pr_gre(fr_info_t *fin) /* Analyze the IPv4 header and set fields in the fr_info_t structure. */ /* Check all options present and flag their presence if any exist. */ /* ------------------------------------------------------------------------ */ -static INLINE void +static inline void ipf_pr_ipv4hdr(fr_info_t *fin) { u_short optmsk = 0, secmsk = 0, auth = 0; @@ -2042,7 +2042,7 @@ ipf_makefrip(int hlen, ip_t *ip, fr_info_t *fin) /* Perform a comparison of a port number against some other(s), using a */ /* structure with compare information stored in it. */ /* ------------------------------------------------------------------------ */ -static INLINE int +static inline int ipf_portcheck(frpcmp_t *frp, u_32_t pop) { int err = 1; @@ -2162,7 +2162,7 @@ ipf_tcpudpchk(fr_ip_t *fi, frtuc_t *ft) /* port numbers, etc, for "standard" IPFilter rules are all orchestrated in */ /* this function. */ /* ------------------------------------------------------------------------ */ -static INLINE int +static inline int ipf_check_ipf(fr_info_t *fin, frentry_t *fr, int portcmp) { u_32_t *ld, *lm, *lip; @@ -6466,7 +6466,7 @@ ipf_outobjk(ipf_main_softc_t *softc, ipfobj_t *obj, void *ptr) /* way that is ditinguishable. This function should only be called by the */ /* ipf_checkv6sum() for each platform. */ /* ------------------------------------------------------------------------ */ -INLINE int +inline int ipf_checkl4sum(fr_info_t *fin) { u_short sum, hdrsum, *csump; diff --git a/sys/netpfil/ipfilter/netinet/ip_compat.h b/sys/netpfil/ipfilter/netinet/ip_compat.h index 4562b0518766..170326dc33f1 100644 --- a/sys/netpfil/ipfilter/netinet/ip_compat.h +++ b/sys/netpfil/ipfilter/netinet/ip_compat.h @@ -282,14 +282,6 @@ typedef union { #define ipf_isw ipf_lkun_s.ipf_sw #define ipf_magic ipf_lkun_s.ipf_magic -#if !defined(__GNUC__) || defined(__FreeBSD__) -# ifndef INLINE -# define INLINE -# endif -#else -# define INLINE __inline__ -#endif - #if defined(__FreeBSD__) && defined(_KERNEL) CTASSERT(sizeof(ipfrwlock_t) == KRWLOCK_FILL_SZ); CTASSERT(sizeof(ipfmutex_t) == KMUTEX_FILL_SZ); diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c index 1e8fcc450dc2..756660a4fb0b 100644 --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c @@ -1012,7 +1012,7 @@ ipf_newisn(fin) } -INLINE int +inline int ipf_checkv4sum(fr_info_t *fin) { #ifdef CSUM_DATA_VALID @@ -1111,7 +1111,7 @@ skipauto: #ifdef USE_INET6 -INLINE int +inline int ipf_checkv6sum(fr_info_t *fin) { if ((fin->fin_flx & FI_NOCKSUM) != 0) {