def pif_datapath(pif):
"""Return the datapath PIF associated with PIF.
-For a non-VLAN PIF, the datapath name is the bridge name.
-For a VLAN PIF, the datapath name is the bridge name for the PIF's VLAN slave.
+A non-VLAN PIF is its own datapath PIF, except that a bridgeless PIF has
+no datapath PIF at all.
+A VLAN PIF's datapath PIF is its VLAN slave's datapath PIF.
"""
if pif_is_vlan(pif):
return pif_datapath(pif_get_vlan_slave(pif))
extra_ports = []
pifrec = db().get_pif_record(self._pif)
+ dprec = db().get_pif_record(self._dp)
ipdev = self._ipdev
bridge = pif_bridge_name(self._dp)
# XXX Needs support in ovs-vsctl
#if bridge == ipdev:
- # vsctl_argv += ['--add=bridge.%s.mac=%s' % (bridge, pifrec['MAC'])]
+ # vsctl_argv += ['--add=bridge.%s.mac=%s' % (bridge, dprec['MAC'])]
#else:
- # vsctl_argv += ['--add=iface.%s.mac=%s' % (ipdev, pifrec['MAC'])]
+ # vsctl_argv += ['--add=iface.%s.mac=%s' % (ipdev, dprec['MAC'])]
self._vsctl_argv = vsctl_argv
self._extra_ports = extra_ports