git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofproto: Avoid wild write removing OFPP_LOCAL port in dealloc_ofp_port().
[sliver-openvswitch.git]
/
ofproto
/
ofproto.c
diff --git
a/ofproto/ofproto.c
b/ofproto/ofproto.c
index
9bae971
..
b6cd082
100644
(file)
--- a/
ofproto/ofproto.c
+++ b/
ofproto/ofproto.c
@@
-1644,7
+1644,9
@@
alloc_ofp_port(struct ofproto *ofproto, const char *netdev_name)
static void
dealloc_ofp_port(const struct ofproto *ofproto, uint16_t ofp_port)
{
static void
dealloc_ofp_port(const struct ofproto *ofproto, uint16_t ofp_port)
{
- bitmap_set0(ofproto->ofp_port_ids, ofp_port);
+ if (ofp_port < ofproto->max_ports) {
+ bitmap_set0(ofproto->ofp_port_ids, ofp_port);
+ }
}
/* Opens and returns a netdev for 'ofproto_port' in 'ofproto', or a null
}
/* Opens and returns a netdev for 'ofproto_port' in 'ofproto', or a null