Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
iproute2
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
iproute2
Commits
bc223ab8
Commit
bc223ab8
authored
Jan 18, 2016
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "tc: fix compilation with old gcc (< 4.6)"
This reverts commit
8f80d450
.
parent
92a0236a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
27 deletions
+21
-27
tc/tc_bpf.c
tc/tc_bpf.c
+21
-27
No files found.
tc/tc_bpf.c
View file @
bc223ab8
...
...
@@ -257,14 +257,12 @@ static bool bpf_may_skip_map_creation(int file_fd)
static
int
bpf_create_map
(
enum
bpf_map_type
type
,
unsigned
int
size_key
,
unsigned
int
size_value
,
unsigned
int
max_elem
)
{
union
bpf_attr
attr
;
memset
(
&
attr
,
0
,
sizeof
(
attr
));
attr
.
map_type
=
type
;
attr
.
key_size
=
size_key
;
attr
.
value_size
=
size_value
;
attr
.
max_entries
=
max_elem
;
union
bpf_attr
attr
=
{
.
map_type
=
type
,
.
key_size
=
size_key
,
.
value_size
=
size_value
,
.
max_entries
=
max_elem
,
};
return
bpf
(
BPF_MAP_CREATE
,
&
attr
,
sizeof
(
attr
));
}
...
...
@@ -272,14 +270,12 @@ static int bpf_create_map(enum bpf_map_type type, unsigned int size_key,
static
int
bpf_update_map
(
int
fd
,
const
void
*
key
,
const
void
*
value
,
uint64_t
flags
)
{
union
bpf_attr
attr
;
memset
(
&
attr
,
0
,
sizeof
(
attr
));
attr
.
map_fd
=
fd
;
attr
.
key
=
bpf_ptr_to_u64
(
key
);
attr
.
value
=
bpf_ptr_to_u64
(
value
);
attr
.
flags
=
flags
;
union
bpf_attr
attr
=
{
.
map_fd
=
fd
,
.
key
=
bpf_ptr_to_u64
(
key
),
.
value
=
bpf_ptr_to_u64
(
value
),
.
flags
=
flags
,
};
return
bpf
(
BPF_MAP_UPDATE_ELEM
,
&
attr
,
sizeof
(
attr
));
}
...
...
@@ -287,17 +283,15 @@ static int bpf_update_map(int fd, const void *key, const void *value,
static
int
bpf_prog_load
(
enum
bpf_prog_type
type
,
const
struct
bpf_insn
*
insns
,
unsigned
int
len
,
const
char
*
license
)
{
union
bpf_attr
attr
;
memset
(
&
attr
,
0
,
sizeof
(
attr
));
attr
.
prog_type
=
type
;
attr
.
insns
=
bpf_ptr_to_u64
(
insns
);
attr
.
insn_cnt
=
len
/
sizeof
(
struct
bpf_insn
);
attr
.
license
=
bpf_ptr_to_u64
(
license
);
attr
.
log_buf
=
bpf_ptr_to_u64
(
bpf_log_buf
);
attr
.
log_size
=
sizeof
(
bpf_log_buf
);
attr
.
log_level
=
1
;
union
bpf_attr
attr
=
{
.
prog_type
=
type
,
.
insns
=
bpf_ptr_to_u64
(
insns
),
.
insn_cnt
=
len
/
sizeof
(
struct
bpf_insn
),
.
license
=
bpf_ptr_to_u64
(
license
),
.
log_buf
=
bpf_ptr_to_u64
(
bpf_log_buf
),
.
log_size
=
sizeof
(
bpf_log_buf
),
.
log_level
=
1
,
};
return
bpf
(
BPF_PROG_LOAD
,
&
attr
,
sizeof
(
attr
));
}
...
...
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