This change needs to be made to the 2NN as well right or were you thinking just the SBN?
Nope, there's no change to be made to the 2NN. The 2NN doesn't do the same sort of validation that the SBN does that the configured NN HTTP address is not INADDR_ANY. The 2NN will automatically start behaving in the same way the SBN does just by virtue of the fact that it's connecting to an NN which doesn't look at the machine name in the param string. The 2NN will also stop sending the machine name in the param string, by virtue of the fact that it uses GetImageServlet#getParamStringToPutImage to form the param string.
I also tested this patch with an NN/2NN, and it works just fine.
NetUtils#isIpAddress actually checks ip:port, seems like we'll always have an IP here. Perhaps better to use InetAddresses.isInetAddress.'
Sure, makes sense. I'll update the patch to suit.
How much more difficult would it be to just have it do a straight HTTP POST or PUT of the new image instead of the "I'll ask you to ask me for this image" dance?
I investigated what it would take to do this a little bit, and concluded that to do it right would take a fair bit of refactoring that's well outside the modest scope of this JIRA. I've filed a separate JIRA to make this change, I hope that's OK: