netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taeung Song <treeze.taeung@gmail.com>
To: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Taeung Song <treeze.taeung@gmail.com>
Subject: [PATCH v2 1/4] samples/bpf: add missing <linux/if_vlan.h>
Date: Wed,  4 Jul 2018 22:36:36 +0900	[thread overview]
Message-ID: <20180704133639.11855-2-treeze.taeung@gmail.com> (raw)
In-Reply-To: <20180704133639.11855-1-treeze.taeung@gmail.com>

This fixes build error regarding redefinition:

    CLANG-bpf  samples/bpf/parse_varlen.o
  samples/bpf/parse_varlen.c:111:8: error: redefinition of 'vlan_hdr'
  struct vlan_hdr {
         ^
  ./include/linux/if_vlan.h:38:8: note: previous definition is here

So remove duplicate 'struct vlan_hdr' in sample code and include if_vlan.h

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
---
 samples/bpf/parse_varlen.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/samples/bpf/parse_varlen.c b/samples/bpf/parse_varlen.c
index 95c16324760c..0b6f22feb2c9 100644
--- a/samples/bpf/parse_varlen.c
+++ b/samples/bpf/parse_varlen.c
@@ -6,6 +6,7 @@
  */
 #define KBUILD_MODNAME "foo"
 #include <linux/if_ether.h>
+#include <linux/if_vlan.h>
 #include <linux/ip.h>
 #include <linux/ipv6.h>
 #include <linux/in.h>
@@ -108,11 +109,6 @@ static int parse_ipv6(void *data, uint64_t nh_off, void *data_end)
 	return 0;
 }
 
-struct vlan_hdr {
-	uint16_t h_vlan_TCI;
-	uint16_t h_vlan_encapsulated_proto;
-};
-
 SEC("varlen")
 int handle_ingress(struct __sk_buff *skb)
 {
-- 
2.17.1

  reply	other threads:[~2018-07-04 13:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-04 13:36 [PATCH v2 0/4] samples/bpf: simple fixes Taeung Song
2018-07-04 13:36 ` Taeung Song [this message]
2018-07-05  5:24   ` [PATCH v2 1/4] samples/bpf: add missing <linux/if_vlan.h> David Miller
2018-07-04 13:36 ` [PATCH v2 2/4] samples/bpf: Check the result of system() Taeung Song
2018-07-05  5:24   ` David Miller
2018-07-04 13:36 ` [PATCH v2 3/4] samples/bpf: Check the error of write() and read() Taeung Song
2018-07-05  5:24   ` David Miller
2018-07-04 13:36 ` [PATCH v2 4/4] samples/bpf: add .gitignore file Taeung Song
2018-07-05  5:24   ` David Miller
2018-07-05  8:03 ` [PATCH v2 0/4] samples/bpf: simple fixes Daniel Borkmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180704133639.11855-2-treeze.taeung@gmail.com \
    --to=treeze.taeung@gmail.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).