From patchwork Thu Jul 6 12:56:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 785166 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3x3Hmj5C79z9s76 for ; Thu, 6 Jul 2017 22:56:21 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3x3Hmj4QlzzDr4M for ; Thu, 6 Jul 2017 22:56:21 +1000 (AEST) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3x3Hmd6XN2zDqRW for ; Thu, 6 Jul 2017 22:56:17 +1000 (AEST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8A91774864; Thu, 6 Jul 2017 12:56:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8A91774864 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=thuth@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8A91774864 Received: from thh440s.str.redhat.com (dhcp-200-180.str.redhat.com [10.33.200.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC7BD60A9F; Thu, 6 Jul 2017 12:56:14 +0000 (UTC) From: Thomas Huth To: slof@lists.ozlabs.org Date: Thu, 6 Jul 2017 14:56:14 +0200 Message-Id: <1499345774-30845-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 06 Jul 2017 12:56:15 +0000 (UTC) Subject: [SLOF] [PATCH] libnet: Move the external declaration of send_ip to ethernet.h X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" When compiling SLOF with the -Wredundant-decls compiler flag, there is currently a warning in the libnet code since the send_ip pointer is currently declared twice, one time in ipv4.h and one time in ipv6.h. To avoid this warning, let's move the declaration to IP-version independent ethernet.h instead. Signed-off-by: Thomas Huth Reviewed-by: Nikunj A Dadhania --- lib/libnet/ethernet.h | 3 +++ lib/libnet/ipv4.h | 2 -- lib/libnet/ipv6.h | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/libnet/ethernet.h b/lib/libnet/ethernet.h index e541c8f..a09e365 100644 --- a/lib/libnet/ethernet.h +++ b/lib/libnet/ethernet.h @@ -44,4 +44,7 @@ extern int send_ether(int fd, void* buffer, int len); extern void fill_ethhdr(uint8_t * packet, uint16_t eth_type, const uint8_t * src_mac, const uint8_t * dest_mac); +/* Points either to send_ipv4() or send_ipv6() */ +extern int (*send_ip)(int fd, void *, int); + #endif diff --git a/lib/libnet/ipv4.h b/lib/libnet/ipv4.h index 5717c9a..3220ab5 100644 --- a/lib/libnet/ipv4.h +++ b/lib/libnet/ipv4.h @@ -71,8 +71,6 @@ extern void set_ipv4_netmask(uint32_t subnet_mask); extern uint32_t get_ipv4_netmask(void); extern uint32_t get_default_ipv4_netmask(char *ip_addr); -extern int (*send_ip) (int fd, void *, int); - /* fills ip header */ extern void fill_iphdr(uint8_t * packet, uint16_t packetsize, uint8_t ip_proto, uint32_t ip_src, uint32_t ip_dst); diff --git a/lib/libnet/ipv6.h b/lib/libnet/ipv6.h index 6f783b3..7b71b50 100644 --- a/lib/libnet/ipv6.h +++ b/lib/libnet/ipv6.h @@ -130,8 +130,6 @@ struct ip6_config { }; /******************** VARIABLES **********************************************/ -/* Function pointer send_ip. Points either to send_ipv4() or send_ipv6() */ -extern int (*send_ip) (int fd, void *, int); extern struct ip6_config ip6_state;