Source: arping
Severity: normal
X-Debbugs-Cc: wuruil...@loongson.cn

Dear Maintainer,

The arping software compiles incorrectly on the loong64 architecture, the 
attached patch has resolved the issue.

wuruilong

-- System Information:
Debian Release: trixie/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: loong64 (loongarch64)

Kernel: Linux 5.10.0-60.96.0.126.oe2203.loongarch64 (SMP w/32 CPU threads)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect
Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 arping (2.24-1) unstable; urgency=medium
 .
   [ Debian Janitor ]
   * Use secure URI in Homepage field.
   * Set upstream metadata fields: Bug-Submit.
 .
   [ Salvatore Bonaccorso ]
   * New upstream version 2.24
   * Declare compliance with Debian policy 4.6.2
   * Update copyright years for debian/* packaging files
Author: Salvatore Bonaccorso <car...@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2024-05-09

--- arping-2.24.orig/configure.ac
+++ arping-2.24/configure.ac
@@ -195,6 +195,26 @@ AC_ARG_ENABLE(warnings,
         CHECK_COMPILER_OPTION([-Wtrampolines])
 ])
 
+AC_DEFUN([CHECK_SECCOMP_SYSCALL], [
+  AC_MSG_CHECKING([seccomp syscall $1])
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include<seccomp.h>
+]], [[
+void test()
+{
+scmp_filter_ctx ctx;
+seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS($1), 0);
+}
+]])],
+[
+  AC_MSG_RESULT(yes)
+  AC_DEFINE([HAVE_SECCOMP_SYSCALL_$1], [1], [Have seccomp syscall])
+],[AC_MSG_RESULT(no)])])
+
+CHECK_SECCOMP_SYSCALL([fstat]);
+CHECK_SECCOMP_SYSCALL([statx]);
+CHECK_SECCOMP_SYSCALL([nonexistant]);
+
 AC_CONFIG_FILES([Makefile])
 AC_CONFIG_FILES([src/Makefile])
 AC_CONFIG_FILES([doc/Makefile])
--- arping-2.24.orig/src/arping.c
+++ arping-2.24/src/arping.c
@@ -645,10 +645,18 @@ static void drop_seccomp(int libnet_fd)
         //
 
         // Write to stdout and stderr.
+#if HAVE_SECCOMP_SYSCALL_statx
+        if (seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(statx), 1, 
SCMP_A0(SCMP_CMP_EQ, STDOUT_FILENO))) {
+                perror("seccomp_rule_add(statx stdout)");
+                exit(1);
+        }
+#endif
+#if HAVE_SECCOMP_SYSCALL_fstat
         if (seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(fstat), 1, 
SCMP_A0(SCMP_CMP_EQ, STDOUT_FILENO))) {
                 perror("seccomp_rule_add(fstat stdout)");
                 exit(1);
         }
+#endif
         if (seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 1, 
SCMP_A0(SCMP_CMP_EQ, STDOUT_FILENO))) {
                 perror("seccomp_rule_add(write stdout)");
                 exit(1);

Reply via email to