Normally it's not a good idea to assign datastore options from code because they are designed to be set by the user.

I guess you can do something like:

```
connect(true, {'RPORT' => redir_port})
```

in order to avoid assigning a new datastore['RPORT'] value