From patchwork Thu Sep 22 13:30:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zack Weinberg X-Patchwork-Id: 15902 Received: (qmail 82874 invoked by alias); 22 Sep 2016 13:31:05 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 82804 invoked by uid 89); 22 Sep 2016 13:31:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=1188, 1996, letter X-HELO: mailbackend.panix.com From: Zack Weinberg To: libc-alpha@sourceware.org Cc: carlos@redhat.com, joseph@codesourcery.com Subject: [PATCH 3a/6] Installed-header hygiene (BZ#20366): struct ifreq. Date: Thu, 22 Sep 2016 09:30:49 -0400 Message-Id: <20160922133054.22210-9-zackw@panix.com> In-Reply-To: <20160922133054.22210-8-zackw@panix.com> References: <20160922133054.22210-1-zackw@panix.com> <20160922133054.22210-2-zackw@panix.com> <20160922133054.22210-3-zackw@panix.com> <20160922133054.22210-4-zackw@panix.com> <20160922133054.22210-5-zackw@panix.com> <20160922133054.22210-6-zackw@panix.com> <20160922133054.22210-7-zackw@panix.com> <20160922133054.22210-8-zackw@panix.com> MIME-Version: 1.0 net/if_ppp.h declares a couple of structures that require struct ifreq, which is only declared by net/if.h under __USE_MISC, so they too should be conditionally declared. Comments in net/if_ppp.h say that it's imported from an external source, but that last happened in 1996 so I think it's probably a dead letter. The Linux and Hurd versions of this file are identical, perhaps they should be un-sysdep-ified. (And there is no generic version!) * sysdeps/mach/hurd/net/if_ppp.h * sysdeps/unix/sysv/linux/net/if_ppp.h: Only define struct ifpppstatsreq and struct ifpppcstatsreq if __USE_MISC is defined. --- sysdeps/mach/hurd/net/if_ppp.h | 3 +++ sysdeps/unix/sysv/linux/net/if_ppp.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sysdeps/mach/hurd/net/if_ppp.h b/sysdeps/mach/hurd/net/if_ppp.h index b210d7f..8ee620b 100644 --- a/sysdeps/mach/hurd/net/if_ppp.h +++ b/sysdeps/mach/hurd/net/if_ppp.h @@ -119,6 +119,8 @@ struct ppp_option_data { int transmit; }; +/* 'struct ifreq' is only available from net/if.h under __USE_MISC. */ +#ifdef __USE_MISC struct ifpppstatsreq { struct ifreq b; struct ppp_stats stats; /* statistic information */ @@ -131,6 +133,7 @@ struct ifpppcstatsreq { #define ifr__name b.ifr_ifrn.ifrn_name #define stats_ptr b.ifr_ifru.ifru_data +#endif /* * Ioctl definitions. diff --git a/sysdeps/unix/sysv/linux/net/if_ppp.h b/sysdeps/unix/sysv/linux/net/if_ppp.h index 9994982..31a20766 100644 --- a/sysdeps/unix/sysv/linux/net/if_ppp.h +++ b/sysdeps/unix/sysv/linux/net/if_ppp.h @@ -118,6 +118,8 @@ struct ppp_option_data { int transmit; }; +/* 'struct ifreq' is only available from net/if.h under __USE_MISC. */ +#ifdef __USE_MISC struct ifpppstatsreq { struct ifreq b; struct ppp_stats stats; /* statistic information */ @@ -130,6 +132,7 @@ struct ifpppcstatsreq { #define ifr__name b.ifr_ifrn.ifrn_name #define stats_ptr b.ifr_ifru.ifru_data +#endif /* * Ioctl definitions.