mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Dahl <post@lespocky.de>
To: ptxdist@pengutronix.de
Cc: Alexander Dahl <post@lespocky.de>
Subject: [ptxdist] [PATCH] libpcap: fix build without INET6
Date: Tue, 20 Jun 2017 13:25:15 +0200	[thread overview]
Message-ID: <1497957915-19723-1-git-send-email-post@lespocky.de> (raw)

With deactivated IPv6 libpcap fails to build. There was a pull request
upstream to fix this, and upstream decided to fix it, but differently:

https://github.com/the-tcpdump-group/libpcap/pull/541

This imports just the one upstream changeset to fix the issue, and
reorganizes the patch series to reflect the different types of patches.

Signed-off-by: Alexander Dahl <post@lespocky.de>
---
 ...01-Fix-compilation-if-INET6-isn-t-defined.patch | 58 ++++++++++++++++++++++
 ...=> 0100-build-and-install-share-lib-only.patch} |  0
 ... => 0101-pcap-config-add-SYSROOT-support.patch} |  0
 ...gure.ac-allow-specifying-path-for-libnl3.patch} |  0
 patches/libpcap-1.8.1/series                       | 11 ++--
 5 files changed, 65 insertions(+), 4 deletions(-)
 create mode 100644 patches/libpcap-1.8.1/0001-Fix-compilation-if-INET6-isn-t-defined.patch
 rename patches/libpcap-1.8.1/{0001-build-and-install-share-lib-only.patch => 0100-build-and-install-share-lib-only.patch} (100%)
 rename patches/libpcap-1.8.1/{0002-pcap-config-add-SYSROOT-support.patch => 0101-pcap-config-add-SYSROOT-support.patch} (100%)
 rename patches/libpcap-1.8.1/{0003-configure.ac-allow-specifying-path-for-libnl3.patch => 0102-configure.ac-allow-specifying-path-for-libnl3.patch} (100%)

diff --git a/patches/libpcap-1.8.1/0001-Fix-compilation-if-INET6-isn-t-defined.patch b/patches/libpcap-1.8.1/0001-Fix-compilation-if-INET6-isn-t-defined.patch
new file mode 100644
index 0000000..7607752
--- /dev/null
+++ b/patches/libpcap-1.8.1/0001-Fix-compilation-if-INET6-isn-t-defined.patch
@@ -0,0 +1,58 @@
+From: Guy Harris <guy@alum.mit.edu>
+Date: Tue, 17 Jan 2017 02:58:52 -0800
+Subject: [PATCH] Fix compilation if INET6 isn't defined.
+
+Addresses GitHub issue #541, but differently from the pull request (it
+defines gen_gateway() with a function prototype rather than using a
+pre-prototype-style definition).
+---
+ gencode.c | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/gencode.c b/gencode.c
+index a887f2730f7a..60494e3de974 100644
+--- a/gencode.c
++++ b/gencode.c
+@@ -523,7 +523,8 @@ static struct block *gen_host6(compiler_state_t *, struct in6_addr *,
+     struct in6_addr *, int, int, int);
+ #endif
+ #ifndef INET6
+-static struct block *gen_gateway(const u_char *, bpf_u_int32 **, int, int);
++static struct block *gen_gateway(compiler_state_t *, const u_char *,
++    bpf_u_int32 **, int, int);
+ #endif
+ static struct block *gen_ipfrag(compiler_state_t *);
+ static struct block *gen_portatom(compiler_state_t *, int, bpf_int32);
+@@ -690,7 +691,9 @@ pcap_compile(pcap_t *p, struct bpf_program *program,
+ 	}
+ 	initchunks(&cstate);
+ 	cstate.no_optimize = 0;
++#ifdef INET6
+ 	cstate.ai = NULL;
++#endif
+ 	cstate.ic.root = NULL;
+ 	cstate.ic.cur_mark = 0;
+ 	cstate.bpf_pcap = p;
+@@ -4902,11 +4905,8 @@ gen_host6(compiler_state_t *cstate, struct in6_addr *addr,
+ 
+ #ifndef INET6
+ static struct block *
+-gen_gateway(eaddr, alist, proto, dir)
+-	const u_char *eaddr;
+-	bpf_u_int32 **alist;
+-	int proto;
+-	int dir;
++gen_gateway(compiler_state_t *cstate, const u_char *eaddr, bpf_u_int32 **alist,
++    int proto, int dir)
+ {
+ 	struct block *b0, *b1, *tmp;
+ 
+@@ -6470,7 +6470,7 @@ gen_scode(compiler_state_t *cstate, const char *name, struct qual q)
+ 		alist = pcap_nametoaddr(name);
+ 		if (alist == NULL || *alist == NULL)
+ 			bpf_error(cstate, "unknown host '%s'", name);
+-		b = gen_gateway(eaddr, alist, proto, dir);
++		b = gen_gateway(cstate, eaddr, alist, proto, dir);
+ 		free(eaddr);
+ 		return b;
+ #else
diff --git a/patches/libpcap-1.8.1/0001-build-and-install-share-lib-only.patch b/patches/libpcap-1.8.1/0100-build-and-install-share-lib-only.patch
similarity index 100%
rename from patches/libpcap-1.8.1/0001-build-and-install-share-lib-only.patch
rename to patches/libpcap-1.8.1/0100-build-and-install-share-lib-only.patch
diff --git a/patches/libpcap-1.8.1/0002-pcap-config-add-SYSROOT-support.patch b/patches/libpcap-1.8.1/0101-pcap-config-add-SYSROOT-support.patch
similarity index 100%
rename from patches/libpcap-1.8.1/0002-pcap-config-add-SYSROOT-support.patch
rename to patches/libpcap-1.8.1/0101-pcap-config-add-SYSROOT-support.patch
diff --git a/patches/libpcap-1.8.1/0003-configure.ac-allow-specifying-path-for-libnl3.patch b/patches/libpcap-1.8.1/0102-configure.ac-allow-specifying-path-for-libnl3.patch
similarity index 100%
rename from patches/libpcap-1.8.1/0003-configure.ac-allow-specifying-path-for-libnl3.patch
rename to patches/libpcap-1.8.1/0102-configure.ac-allow-specifying-path-for-libnl3.patch
diff --git a/patches/libpcap-1.8.1/series b/patches/libpcap-1.8.1/series
index 5b8e8a2..7e01f06 100644
--- a/patches/libpcap-1.8.1/series
+++ b/patches/libpcap-1.8.1/series
@@ -1,6 +1,9 @@
 # generated by git-ptx-patches
 #tag:base --start-number 1
-0001-build-and-install-share-lib-only.patch
-0002-pcap-config-add-SYSROOT-support.patch
-0003-configure.ac-allow-specifying-path-for-libnl3.patch
-# 04919371617f914a399e4491d8b76206  - git-ptx-patches magic
+#tag:upstream --start-number 1
+0001-Fix-compilation-if-INET6-isn-t-defined.patch
+#tag:ptx --start-number 100
+0100-build-and-install-share-lib-only.patch
+0101-pcap-config-add-SYSROOT-support.patch
+0102-configure.ac-allow-specifying-path-for-libnl3.patch
+# 363b6cba4073355bfab4a58107b4a1da  - git-ptx-patches magic
-- 
2.1.4


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

                 reply	other threads:[~2017-06-20 11:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497957915-19723-1-git-send-email-post@lespocky.de \
    --to=post@lespocky.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox