Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
6d8381c7
Commit
6d8381c7
authored
Jul 22, 2015
by
Yonghong Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update ifindex/vlan info unconditionally in the map in vlan_learning example
Signed-off-by:
Yonghong Song
<
yhs@plumgrid.com
>
parent
540d45a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
examples/vlan_learning.c
examples/vlan_learning.c
+4
-8
No files found.
examples/vlan_learning.c
View file @
6d8381c7
...
...
@@ -33,14 +33,10 @@ int handle_phys2virt(struct __sk_buff *skb) {
int
out_ifindex
=
leaf
->
out_ifindex
;
struct
ifindex_leaf_t
zleaf
=
{
0
};
struct
ifindex_leaf_t
*
out_leaf
=
egress
.
lookup_or_init
(
&
out_ifindex
,
&
zleaf
);
// relearn when mac moves ifindex
if
(
out_leaf
->
out_ifindex
!=
skb
->
ifindex
)
out_leaf
->
out_ifindex
=
skb
->
ifindex
;
// relearn when vlan_tci/vlan_proto changes
if
(
out_leaf
->
vlan_tci
!=
skb
->
vlan_tci
)
out_leaf
->
vlan_tci
=
skb
->
vlan_tci
;
if
(
out_leaf
->
vlan_proto
!=
skb
->
vlan_proto
)
out_leaf
->
vlan_proto
=
skb
->
vlan_proto
;
// to capture potential configuration changes
out_leaf
->
out_ifindex
=
skb
->
ifindex
;
out_leaf
->
vlan_tci
=
skb
->
vlan_tci
;
out_leaf
->
vlan_proto
=
skb
->
vlan_proto
;
// pop the vlan header and send to the destination
bpf_skb_vlan_pop
(
skb
);
bpf_clone_redirect
(
skb
,
leaf
->
out_ifindex
,
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment