There are two commits upstream since the v1.5.3 release which both fix
build errors in certain environments.

Signed-off-by: Alexander Dahl <[email protected]>
---
 ...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 <[email protected]>
+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 <[email protected]>
+---
+ 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 <[email protected]>
+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 <[email protected]>
+---
+ 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
[email protected]
To unsubscribe, send a mail with subject "unsubscribe" to 
[email protected]

Reply via email to