The message is somewhat unclear at first, I had to read the code to understand it, which is bad. How about "Invalid protocol specified, using IPv4 instead. Server may be inaccessible."?

Also move the log above the assert, so that in debug mode it first logs, then aborts.