I recently decided to switch from using tcp/ip to udp for my server. I now have the udp server running but I was wondering, I most likely need to handle new connections and old connections differently, correct? That way, someone couldn't just start acting like they were already authenticated...
The best way to do this would be looping through a list of sockaddr_ins?

for ( int x = 1; x < maxcon; x++ ) {
  if  ( conlist[x].inuse == 1 ) {
      if ( !memcmp(conlist[x].sockaddrin, newaddrin, sizeof (sockaddr_in)) ) {
            //already authenticated (or atleast not new connection)
if this is actually the best way to differentiate between new and older "connections", what is wrong with memcmp? For some reason, it is returning -1 when they such be the same thing since I had previously filled the first parameter (conlist[<number>].sockaddrin) with newaddrin as the user connects. Sorry if this makes little sense, I'm not very good at explaining =(