new_connection always becomes true or false, and the value you actually expect to be stored gets lost. You probably meant this:
while ((new_connection = accept(fd, &new_addr, &len)) != -1)
Nasty one :D
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.