[ovs-dev] [PATCH] alloc_ofp_port does not allocate the port number correctly

Jarno Rajahalme jarno.rajahalme at nsn.com
Thu Jan 10 10:23:47 UTC 2013


On Jan 10, 2013, at 2:10 , ext Krishna Kondaka wrote:
> 
> From: Krishna Kondaka <kkondaka at vmware.com>
> 
> 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!
> 

I've seen this happening. For example if you add multiple ports and
(accidentally) have the same ofport_request option (e.g. "ofport_request=1")
only the last of the added ports is visible. I haven't checked this, but it seems
to me that in this case all of the ports still exist, but only last of them is
mappable from the underlying dpif port.




More information about the dev mailing list