News for hackers. Stuff that matters.
Re:A New Future for Icanhazip by andrewmcwatters on Sunday June 06, 2021 @09:00PM (#27417876)
Yes it is? I'm not talking about a situation where you send a packet to a DHCP server with 0.0.0.0 in the headers, I'm talking about what happens after the fact.

Once you have been allocated an IP address, there should be a way to fetch said address. That's the whole mechanism behind forging UDP packets. If I didn't know what my source IP address was, it would be OK to send 0.0.0.0 out into the world all the time.

Practically speaking, today, it is, considering most, but not all, ISPs won't let you do this and they will rewrite UDP packets that attempt to forge their source.

Edit: OK, since I'm not being clear, let me be explicit: There should be a mechanism in DHCP which allows for the querying of your public Internet address when receiving a packet from a client in one of the Private-Use Networks as defined in RFC 6890. This query should be exposed as a feature of ifconfig or ip, lest a user be forced to manually write such a packet to receive the data.

Re:A New Future for Icanhazip by lmm on Sunday June 06, 2021 @11:24PM (#27418717)
Private-use networks connected to the public internet are an ugly hack. If you don't have a public address, you don't have a public address in any meaningful sense, so any effort to figure out "your" address is doomed from the start.

Particularly in these days of IPv6, just give everything a notionally publicly routable address and then every device can know its real address (of course this doesn't have to mean you actually route public traffic to every address if you don't want to).

Re:A New Future for Icanhazip by quesera on Monday June 07, 2021 @10:34AM (#27423089)
I'm not sure I follow your model of IP networking, but the problem boils down this:

In live networks, you don't always know which device presents your last-hop routable address to the public network, so it is not clear who can authoritatively answer the whatismyip question.

You can get an instantaneously-correct answer (i.e. correct in the instant, not necessarily quickly-answered) from an empirical test, but you need to choose an known (and trusted) entity on the public network to query. Querying multiple different entities might very well get you multiple different answers, depending on how your packets are routed and manipulated before they reach the public network.

And in all cases, there is no guarantee that your public address will be stable over time or location.

Re:A New Future for Icanhazip by numpad0 on Monday June 07, 2021 @12:22AM (#27418974)
I guess you can pick an empty or safe spot from here[1] and send patches to major DHCP server implementations, feels like option 81 "Client FQDN" is already close to that though.

Also do keep in mind that an OS instance can have multiple Ethernet interfaces, and that each interface can have multiple IPs, and that not all DHCP gives out private addresses(University Wi-Fi gave me 133.xx back in the days ... behind NAT!), and that double NAT exists.

1: https://www.iana.org/assignments/bootp-dhcp-parameters/bootp...

Re:A New Future for Icanhazip by cowsandmilk on Sunday June 06, 2021 @09:11PM (#27417942)
> Once you have been allocated an IP address

Well, there’s assumption 1 that isn’t true, often, you aren’t allocated a public IP address…at least in IPv4 world

Re:A New Future for Icanhazip by viraptor on Sunday June 06, 2021 @10:20PM (#27418317)
> querying of your public Internet address

Upnp allows you to do that. But that relies on a lot of assumptions. Your address when connecting to X and Y could be different. It could be different depending on the port. It could be load-balanced and come randomly from a pool. It could vary depending on time of day. And many many other cases.

Re:A New Future for Icanhazip by fierro on Sunday June 06, 2021 @10:31PM (#27418389)
you could be behind NAT or reverse proxies or any number of virtual or physical network components. This service helps account for all of that.