gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Problems with UDP - sendto only sends in own subnet ?!

#121437 - qw3rty - Mon Mar 12, 2007 1:53 pm

Hi,

I recently updated to the newest wifi-lib (CVS), adn now my app doesn't connect to IP's that aren't in the NDS's subnet.
I use the UDP-socket code of wifi-lib-test 0.3a as base for my app.

This is how I open the socket :
Code:

        sock=socket(AF_INET,SOCK_DGRAM,0);
   sa_incoming.sin_family=AF_INET;
   sa_incoming.sin_port=htons(portnum_game);
   sa_incoming.sin_addr.s_addr=INADDR_ANY;
   if (bind(sock,(struct sockaddr *) &sa_incoming,sizeof(sa_incoming)) == -1)
   {
      closesocket(sock);
      return -1;
   }
   ioctl(sock,FIONBIO,&i);


This is how I send :
Code:

        sa_outgoing.sin_family=AF_INET;
   sa_outgoing.sin_port=htons(portnum);
   sa_outgoing.sin_addr.s_addr=destip;

   //send packet
   num_bytes_sent = sendto(sock,((u8*)buffer,buffer_len,0,(struct sockaddr *)&sa_outgoing,sizeof(sa_outgoing));




If destip is not within the own subnet, the NDS does send NOTHING (not even an ARP-request)

P.S: I also tried wifi-lib-test 0.3a compiled with the newset dswifi-lib (and of course adapted to work again - close --> closesocket) with the same results. Not a packet sent out, if it's in a different subnet :(

P.P.S. : TCP-connections can't connect to the outside either.(tried with wifi-lib-test, compiled with the cvs-lib)

P.P.P.S : I compiled it wih wifi-lib 0.3c, and it works again :O

#121441 - qw3rty - Mon Mar 12, 2007 2:52 pm

Better a new post, than yet another P.S. :

I have tried 3 different wifi-libs now :

wifi-lib0.3c - WORKS
wifi-lib0.3d - WORKS
wifi-lib CVS - BROKEN !!!

no idea what's wrong though - I haven't found any recent changes in CVS-browse :-?
And the only thing I change is the wifi-lib, I keep the CVS-libnds

#121444 - Lick - Mon Mar 12, 2007 2:55 pm

How do you transfer the binary?
_________________
http://licklick.wordpress.com

#121447 - qw3rty - Mon Mar 12, 2007 3:00 pm

Transfer the binary ? to the NDS you mean ?
I transfer it with wifi-transfer (I changed it to use dldi, it corrupted my CF-card all the time ;) )

I turn off the NDS before starting my app though - learned it the hard way (see my other topic).
(so I doubt wifitransfer is interfering with my app)

#121449 - Lick - Mon Mar 12, 2007 3:02 pm

Could you not copy it manually (wired)?
_________________
http://licklick.wordpress.com

#121470 - qw3rty - Mon Mar 12, 2007 5:04 pm

I could of course unplug my card, put the CF-card in the card-reader, and transfer it by USB-cable, but do you really think it would make a difference ?
wifi-lib 0.3d (non-CVS) also works transferred by wifitransfer.