[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] macOS sockets broken (#428)
Tobias Pape
notifications at github.com
Thu Sep 17 13:25:52 UTC 2020
When using new network, the tests use an IPv6-based localhost address for binding and connecting.
The local socket is opened in `setUp`:
```Smalltalk
setUp
listenerSocket := Socket newTCP listenOn: self listenerPort backlogSize: 4 interface: self listenerAddress.
```
The `listenerAddress` is derived as follows:
```Smalltalk
^ NetNameResolver addressForName: 'localhost'
```
In `oldNetwork`, that's an IPv4, in `!oldNetwork` that's an IPv6. _this is good_
However, the _Socket_ is created as `newTCP`, that is, _explicitely IPv4_:
```Smalltalk
newTCP
"Create a socket and initialise it for TCP"
^self newTCP: SocketAddressInformation addressFamilyINET4
```
This is bad. This is where the Error message comes from.
This should be changed to use the address familty that fits best to the current old/new-network.
On top of that, `#listenOn:backlogSize: interface:` *solely* deals with IPv4 adresses.
The correct way is to use the indirection of `SocketAddressInformation` in `#listenWithBacklog:`.
This deals correctly with the address family.
Things to do:
- [ ] fix the test setup to use the SAI info and/or discriminate old/new network
- [ ] maybe Bail in the socket plugin earlier when a new-network socket is used in old-network-ipv4-only code.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/428#issuecomment-694231185
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20200917/31b8da9d/attachment.html>
More information about the Vm-dev
mailing list