Thread (19 messages) flat view 19 messages, 5 authors, 2021-01-27

Re: [PATCH v3 2/7] can: Add can_common.h for vcan device setup

From: Oliver Hartkopp <socketcan@hartkopp.net>
Date: 2021-01-27 08:18:56
Also in: ltp

Hi Petr,

On 26.01.21 22:28, Petr Vorel wrote:
Hi Oliver, Richie,
quoted
quoted
quoted
--- /dev/null
+++ b/testcases/network/can/filter-tests/can_common.h
@@ -0,0 +1,75 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2021 SUSE LLC
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include "tst_cmd.h"
+#include "tst_safe_stdio.h"
+#include "tst_safe_file_ops.h"
+
+#include <linux/if.h>
+#include <linux/can.h>
+#include <linux/can/raw.h>
+
+#ifndef IFF_ECHO
+# define IFF_ECHO (1<<18)
+#endif
Thanks a lot, Richie!
quoted
quoted
IFF_ECHO was included into Linux 2.6.25 together with the CAN
subsystem itself.
quoted
quoted
So when you run the tests on Kernels < 2.6.25 you don't have CAN
support and don't need IFF_ECHO too.
quoted
Petr, what kernel version and/or distro version did compilation fail on?
quoted
There is a small chance someone might be compiling with old kernel
headers relative to their kernel. However it is a challenge to compile
LTP with such an old user land.
No, we don't support 2.6.25 :). I was playing with Buildroot distro in my spare time.
These embedded toolchains suffer compatibility problems (usually uclibc-ng and
sometimes musl lack the support). This problem was when using sourcery-arm-*.
:-/
But this is definitely not a blocker for this patchset. That lapi is not a must,
I can fix it some time later. I usually fix few of these problems before each
LTP release.
Ok. No problem. I wasn't aware that e.g. musl or other toolchains select 
such strange starting points for their include files.

Thanks,
Oliver
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help