projects
/
openvswitch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eca2aeb
)
Don't allow unsupported flags to be set in the switch.
author
Ben Pfaff
<blp@nicira.com>
Tue, 5 Aug 2008 20:51:29 +0000
(13:51 -0700)
committer
Ben Pfaff
<blp@nicira.com>
Thu, 7 Aug 2008 17:34:37 +0000
(10:34 -0700)
datapath/forward.c
patch
|
blob
|
history
switch/datapath.c
patch
|
blob
|
history
diff --git
a/datapath/forward.c
b/datapath/forward.c
index 4dee840b48e03ad1f27cd5673b302b199e4f06cc..7167fbfc76883112e09b5ab9ebec6ddc7847e460 100644
(file)
--- a/
datapath/forward.c
+++ b/
datapath/forward.c
@@
-306,8
+306,15
@@
recv_set_config(struct sw_chain *chain, const struct sender *sender,
const void *msg)
{
const struct ofp_switch_config *osc = msg;
const void *msg)
{
const struct ofp_switch_config *osc = msg;
+ int flags;
+
+ flags = ntohs(osc->flags) & ~(OFPC_SEND_FLOW_EXP | OFPC_FRAG_MASK);
+ if ((flags & OFPC_FRAG_MASK) != OFPC_FRAG_NORMAL
+ && (flags & OFPC_FRAG_MASK) != OFPC_FRAG_DROP) {
+ flags = (flags & ~OFPC_FRAG_MASK) | OFPC_FRAG_DROP;
+ }
+ chain->dp->flags = flags;
- chain->dp->flags = ntohs(osc->flags);
chain->dp->miss_send_len = ntohs(osc->miss_send_len);
return 0;
chain->dp->miss_send_len = ntohs(osc->miss_send_len);
return 0;
diff --git
a/switch/datapath.c
b/switch/datapath.c
index 4391634bdb78614abaff27535dc881af8f33b2cd..13d06ff1d3c07a12352efa0686a82b8c31c5125d 100644
(file)
--- a/
switch/datapath.c
+++ b/
switch/datapath.c
@@
-983,7
+983,14
@@
recv_set_config(struct datapath *dp, const struct sender *sender UNUSED,
const void *msg)
{
const struct ofp_switch_config *osc = msg;
const void *msg)
{
const struct ofp_switch_config *osc = msg;
- dp->flags = ntohs(osc->flags);
+ int flags;
+
+ flags = ntohs(osc->flags) & ~(OFPC_SEND_FLOW_EXP | OFPC_FRAG_MASK);
+ if ((flags & OFPC_FRAG_MASK) != OFPC_FRAG_NORMAL
+ && (flags & OFPC_FRAG_MASK) != OFPC_FRAG_DROP) {
+ flags = (flags & ~OFPC_FRAG_MASK) | OFPC_FRAG_DROP;
+ }
+ dp->flags = flags;
dp->miss_send_len = ntohs(osc->miss_send_len);
return 0;
}
dp->miss_send_len = ntohs(osc->miss_send_len);
return 0;
}