... answers 127.0.0.1 on the A-test board.
Yes I know that machines don't have an address but interfaces do. Still, can we make this answer the address of the default interface? The one marked default (dest addr = 0.0.0.0) in the routing table?
- Bert -
On Oct 18, 2006, at 5:06 AM, Bert Freudenberg wrote:
... answers 127.0.0.1 on the A-test board.
can we make this answer the address of the default interface?
You mean the address of the default gateway? While in some situations it might be the same as the local host address, on the vast majority of machines in the world it's the address of a remote machine.
The one marked default (dest addr = 0.0.0.0) in the routing table?
That isn't even a valid host address; it's the address of an entire network (or the least restrictive wildcard address, depending what you're using it for).
FWIW, having the primary IP address set to 0.0.0.0 is usually symptomatic of your interface having received no configuration information from DHCP or BOOTP. In normal operation when connected to a network you should never see a physical interface configured with this address.
If you are convinced you need to send stuff to 0.0.0.0 then you might consider implementing 'defaultNetworkAddress' next to localHostAddress in the image (return #[0 0 0 0]) and replace sends of the latter with sends of the former. Breaking the localHostAddress primitive for everyone who wants to restrict incoming connections to those originating on the primary interface of the local physical host seems completely the wrong thing to do.
Cheers, Ian
Am 18.10.2006 um 18:09 schrieb Ian Piumarta:
On Oct 18, 2006, at 5:06 AM, Bert Freudenberg wrote:
... answers 127.0.0.1 on the A-test board.
can we make this answer the address of the default interface?
You mean the address of the default gateway? While in some situations it might be the same as the local host address, on the vast majority of machines in the world it's the address of a remote machine.
The one marked default (dest addr = 0.0.0.0) in the routing table?
That isn't even a valid host address; it's the address of an entire network (or the least restrictive wildcard address, depending what you're using it for).
I know. I meant return the IP address of the interface that packets for any non-local address are routed through. That is the interface connecting to the default gateway. If you do a "route -n" on Linux it's the route marked with a 0.0.0.0 destination address, which matches *any* address.
Breaking the localHostAddress primitive for everyone who wants to restrict incoming connections to those originating on the primary interface of the local physical host seems completely the wrong thing to do.
Well, what's the "primary" interface? Isn't that pretty random? On some linux machines the primitive actually does answer the external interface's address (assuming there is just one). On the OLPC machine it does not.
Answering 127.0.0.1 from the primitive is useless because I do no need a primitive to tell me that this is my loopback address.
If I want to share my world I go to the help/telemorphic menu and let it display my host address so others can connect to it. That won't work if they try to connect to 127.0.0.1. So, ignoring everything I said above, what should we do instead?
- Bert -
etoys-dev@lists.squeakfoundation.org