From: Alexander Dahl <ada@thorsis.com>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH 3/3] dropwatch: Add upstream patches
Date: Thu, 2 Jul 2020 09:35:40 +0200 [thread overview]
Message-ID: <20200702073540.24100-4-ada@thorsis.com> (raw)
In-Reply-To: <20200702073540.24100-1-ada@thorsis.com>
There are two commits upstream since the v1.5.3 release which both fix
build errors in certain environments.
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
...ssue-when-compiling-with-Wcast-align.patch | 47 +++++++++++++++++++
.../0002-Fix-configure-for-libnl3-genl.patch | 43 +++++++++++++++++
patches/dropwatch-1.5.3/series | 5 ++
3 files changed, 95 insertions(+)
create mode 100644 patches/dropwatch-1.5.3/0001-Fix-build-issue-when-compiling-with-Wcast-align.patch
create mode 100644 patches/dropwatch-1.5.3/0002-Fix-configure-for-libnl3-genl.patch
create mode 100644 patches/dropwatch-1.5.3/series
diff --git a/patches/dropwatch-1.5.3/0001-Fix-build-issue-when-compiling-with-Wcast-align.patch b/patches/dropwatch-1.5.3/0001-Fix-build-issue-when-compiling-with-Wcast-align.patch
new file mode 100644
index 000000000..d63d0b18a
--- /dev/null
+++ b/patches/dropwatch-1.5.3/0001-Fix-build-issue-when-compiling-with-Wcast-align.patch
@@ -0,0 +1,47 @@
+From: Neil Horman <nhorman@tuxdriver.com>
+Date: Sat, 21 Mar 2020 07:22:29 -0400
+Subject: [PATCH] Fix build issue when compiling with -Wcast-align
+
+Passing a char buffer cast to struct nlmsghdr * violates the rules of
+-Wcast-align on some arches, as described in :
+https://github.com/nhorman/dropwatch/issues/26
+
+Fix it by declaring the buffer as a struct nlmsghdr, and casting to a
+less alligned type
+
+Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
+---
+ src/main.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/main.c b/src/main.c
+index bd87085d7dc8..2253fc4eb8c1 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -267,7 +267,7 @@ int send_netlink_message(struct netlink_message *msg)
+
+ struct netlink_message *recv_netlink_message(int *err)
+ {
+- static unsigned char *buf;
++ static struct nlmsghdr *buf;
+ struct netlink_message *msg;
+ struct genlmsghdr *glm;
+ struct sockaddr_nl nla;
+@@ -277,7 +277,7 @@ struct netlink_message *recv_netlink_message(int *err)
+ *err = 0;
+
+ do {
+- rc = nl_recv(nsd, &nla, &buf, NULL);
++ rc = nl_recv(nsd, &nla, (unsigned char **)&buf, NULL);
+ if (rc < 0) {
+ switch (errno) {
+ case EINTR:
+@@ -294,7 +294,7 @@ struct netlink_message *recv_netlink_message(int *err)
+ }
+ } while (rc == 0);
+
+- msg = wrap_netlink_msg((struct nlmsghdr *)buf);
++ msg = wrap_netlink_msg(buf);
+
+ type = ((struct nlmsghdr *)msg->msg)->nlmsg_type;
+
diff --git a/patches/dropwatch-1.5.3/0002-Fix-configure-for-libnl3-genl.patch b/patches/dropwatch-1.5.3/0002-Fix-configure-for-libnl3-genl.patch
new file mode 100644
index 000000000..5c39d8201
--- /dev/null
+++ b/patches/dropwatch-1.5.3/0002-Fix-configure-for-libnl3-genl.patch
@@ -0,0 +1,43 @@
+From: Neil Horman <nhorman@tuxdriver.com>
+Date: Wed, 20 May 2020 07:08:47 -0400
+Subject: [PATCH] Fix configure for libnl3-genl
+
+Apparently, way back when we wrote the configure script, we included a
+package check for libnl, but not libnl3-genl (ostensibly because it
+didn't exist I think), and so we hardcoded linking to -lnl3-genl. The
+pkg-config file for that library exists now, so lets actually test for
+it during the running of configure, and use its output during make
+
+Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
+---
+ configure.ac | 1 +
+ src/Makefile.am | 4 ++--
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ad917022eb82..278da5479152 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -14,6 +14,7 @@ AC_PROG_AWK
+ AC_CHECK_FUNCS(getopt_long)
+
+ PKG_CHECK_MODULES([LIBNL3], [libnl-3.0], [], [AC_MSG_ERROR([libnl-3.0 is required])])
++PKG_CHECK_MODULES([LIBNLG3], [libnl-genl-3.0], [], [AC_MSG_ERROR([libnl-genl-3.0 is required])])
+ # Fallback on using -lreadline as readline.pc is only available since version 8.0
+ PKG_CHECK_MODULES([READLINE], [readline], [], [READLINE_LIBS=-lreadline])
+ PKG_CHECK_MODULES([LIBPCAP], [libpcap], [], [
+diff --git a/src/Makefile.am b/src/Makefile.am
+index a324fd36eb9e..f56a39dcf274 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -1,8 +1,8 @@
+
+ bin_PROGRAMS = dropwatch dwdump
+
+-AM_CFLAGS = -g -Wall -Werror $(LIBNL3_CFLAGS) $(READLINE_CFLAGS)
+-AM_LDFLAGS = $(LIBNL3_LIBS) -lnl-genl-3 $(READLINE_LIBS) -lpcap
++AM_CFLAGS = -g -Wall -Werror $(LIBNL3_CFLAGS) $(LIBNLG3_CFLAGS) $(READLINE_CFLAGS)
++AM_LDFLAGS = $(LIBNL3_LIBS) $(LIBNLG3_LIBS) $(READLINE_LIBS) -lpcap
+ AM_CPPFLAGS = -D_GNU_SOURCE
+
+ dropwatch_SOURCES = main.c lookup.c lookup_kas.c
diff --git a/patches/dropwatch-1.5.3/series b/patches/dropwatch-1.5.3/series
new file mode 100644
index 000000000..f3c5dd88d
--- /dev/null
+++ b/patches/dropwatch-1.5.3/series
@@ -0,0 +1,5 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Fix-build-issue-when-compiling-with-Wcast-align.patch
+0002-Fix-configure-for-libnl3-genl.patch
+# 68fccae5492fb3b53d1b549cfe32ed5f - git-ptx-patches magic
--
2.26.2
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
next prev parent reply other threads:[~2020-07-02 7:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 7:35 [ptxdist] [PATCH 0/3] dropwatch: Post upgrade tweaks Alexander Dahl
2020-07-02 7:35 ` [ptxdist] [PATCH 1/3] dropwatch: Update license information Alexander Dahl
2020-07-06 6:31 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-07-02 7:35 ` [ptxdist] [PATCH 2/3] dropwatch: Update help text Alexander Dahl
2020-07-06 6:31 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-07-02 7:35 ` Alexander Dahl [this message]
2020-07-06 6:31 ` [ptxdist] [APPLIED] dropwatch: Add upstream patches Michael Olbrich
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=20200702073540.24100-4-ada@thorsis.com \
--to=ada@thorsis.com \
--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