From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.thorsis.com ([92.198.35.195]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jqtl7-0007gh-5c for ptxdist@pengutronix.de; Thu, 02 Jul 2020 09:35:52 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.thorsis.com (Postfix) with ESMTP id 6CBB62A7C for ; Thu, 2 Jul 2020 09:35:48 +0200 (CEST) Received: from mail.thorsis.com ([127.0.0.1]) by localhost (mail.thorsis.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2W990LY-ra-q for ; Thu, 2 Jul 2020 09:35:48 +0200 (CEST) Received: from adahl by ada.ifak-system.com with local (Exim 4.92) (envelope-from ) id 1jqtky-0006HX-6i for ptxdist@pengutronix.de; Thu, 02 Jul 2020 09:35:40 +0200 From: Alexander Dahl Date: Thu, 2 Jul 2020 09:35:40 +0200 Message-Id: <20200702073540.24100-4-ada@thorsis.com> In-Reply-To: <20200702073540.24100-1-ada@thorsis.com> References: <20200702073540.24100-1-ada@thorsis.com> Subject: [ptxdist] [PATCH 3/3] dropwatch: Add upstream patches List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de There are two commits upstream since the v1.5.3 release which both fix build errors in certain environments. Signed-off-by: Alexander Dahl --- ...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 +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 +--- + 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 +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 +--- + 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