def _open_dhcp_ext_socket(self):

        # find configured external interface ip address
        for ifname, addr, mask in netns.iflist():
            if ifname == self.conf.cisco_pnr.external_interface:
                break
        else:
            raise UnexpectedError(msg='Failed to find external intf '
                                      'matching config')

        # open, bind, and connect UDP socket
        s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        s.bind((addr, DHCP_SERVER_PORT))
        s.connect((self.conf.cisco_pnr.dhcp_server_addr,
                   self.conf.cisco_pnr.dhcp_server_port))
        return s, addr
dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/plugins/cisco/cpnr/dhcp_relay.py/DhcpRelayAgent._open_dhcp_ext_socket/original