From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: In-Reply-To: <20200702073540.24100-4-ada@thorsis.com> MIME-Version: 1.0 Message-Id: From: Michael Olbrich Date: Mon, 06 Jul 2020 08:31:59 +0200 Subject: Re: [ptxdist] [APPLIED] 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Cc: Alexander Dahl Thanks, applied as ea5a3062b785f280a6a580859c9d4217dd52d2cc. Michael [sent from post-receive hook] On Mon, 06 Jul 2020 08:31:59 +0200, Alexander Dahl wrote: > There are two commits upstream since the v1.5.3 release which both fix > build errors in certain environments. > > Signed-off-by: Alexander Dahl > Message-Id: <20200702073540.24100-4-ada@thorsis.com> > Signed-off-by: Michael Olbrich > > 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 000000000000..d63d0b18a531 > --- /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 000000000000..5c39d820134d > --- /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 000000000000..f3c5dd88de16 > --- /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 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de