You say that like there MUST be a way to detect an infinite loop (yet Alan Turing PROVED it impossible). Like there MUST be a way to cram 13 eggs into an egg carton only built for 12 without breaking anything.
Therein lies your problem. The way IPv4 is set up with some HARD limits. It's basically designed NOT to be expandable so as to be simple (consider the timeframe it was developed--when silicon horsepower was pretty precious--the whole "can you fit everything into a few kB of RAM and a sub-MHz processor" thing). At some point, you can't expand anymore without bringing the whole works down. Trying to bolt something onto IPv4 will just create vulnerabilities that can bring the whole works down.