From 78a0f734f9a7a15479b6ead616a0d9bee38a916b Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Mon, 18 Jul 2016 10:53:44 -0300 Subject: [PATCH] in-band: use open_type when opening internal device in-band code will open a device that it expects to be the main internal port of the bridge. However, it's possible that the correct type is a different one. For dpif-netdev, it might be a tap device, or a dummy device for dummy datapaths. ofproto_port_open_type will give the correct type. While this doesn't cause any problems right now, as the needed type would be opened already, a later patch assumes netdev with different types cannot be opened. Signed-off-by: Thadeu Lima de Souza Cascardo --- ofproto/in-band.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ofproto/in-band.c b/ofproto/in-band.c index 36e80f493..e3ee41a4d 100644 --- a/ofproto/in-band.c +++ b/ofproto/in-band.c @@ -422,9 +422,10 @@ in_band_create(struct ofproto *ofproto, const char *local_name, struct in_band *in_band; struct netdev *local_netdev; int error; + const char *type = ofproto_port_open_type(ofproto->type, "internal"); *in_bandp = NULL; - error = netdev_open(local_name, "internal", &local_netdev); + error = netdev_open(local_name, type, &local_netdev); if (error) { VLOG_ERR("%s: failed to initialize in-band control: cannot open " "datapath local port %s (%s)", ofproto->name, -- 2.20.1