git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6530561
)
Properly allocate flow action blocks in user-space switch.
author
Justin Pettit
<jpettit@nicira.com>
Tue, 30 Sep 2008 21:19:47 +0000
(14:19 -0700)
committer
Justin Pettit
<jpettit@nicira.com>
Tue, 30 Sep 2008 21:19:47 +0000
(14:19 -0700)
The user-space switch was allocating blocks to hold actions in flows that
did not include the action header.
switch/switch-flow.c
patch
|
blob
|
history
diff --git
a/switch/switch-flow.c
b/switch/switch-flow.c
index
a42d00f
..
133e4f8
100644
(file)
--- a/
switch/switch-flow.c
+++ b/
switch/switch-flow.c
@@
-173,11
+173,12
@@
struct sw_flow *
flow_alloc(int n_actions)
{
struct sw_flow_actions *sfa;
+ size_t size = sizeof *sfa + (n_actions * sizeof sfa->actions[0]);
struct sw_flow *flow = malloc(sizeof *flow);
if (!flow)
return NULL;
- sfa = malloc(
n_actions * sizeof sfa->actions[0]
);
+ sfa = malloc(
size
);
if (!sfa) {
free(flow);
return NULL;