alloc_ofp_port does not allocate the port number correctly
authorKrishna Kondaka <kkondaka@vmware.com>
Fri, 11 Jan 2013 05:20:22 +0000 (21:20 -0800)
committerJustin Pettit <jpettit@nicira.com>
Fri, 11 Jan 2013 18:33:51 +0000 (10:33 -0800)
commit6033d9d9d7058b1fb83f8235a6eed0572285b97c
tree919fb4bf484ae140e9fbc30710a2da8ae5acc5f2
parent8e70e196a26404ab9e2f881cb8c383ef5fc4af29
alloc_ofp_port does not allocate the port number correctly

alloc_ofp_port() does not allocate the port number correctly if the port
number passed initially is already in use. The following if block

if (ofp_port >= ofproto->max_ports
            || bitmap_is_set(ofproto->ofp_port_ids, ofp_port)) {

is entered when either of the two conditions is true but the while block
after this is not entered if the second condition above is true and the
first condition is false.

This results in an existing port_number to be re-assigned!

Signed-off-by: Krishna Kondaka <kkondaka@vmware.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
AUTHORS
ofproto/ofproto.c