Sending data using UDP results in endPacket() returning 0 and no packet is sent

I have had a running sample using Arduino Uno and the Ethernet Shield receiving and sending data using UDP. Now I upgraded to Arduino 1.0 with a new pair of Uno and Ethernet Shield and run into the following problems:

  1. I was not able to correctly receive UDP data, that was solved by upgrading to the Arduino Version 1.0.1 (or maybe some 1.0 with the UDP fix) that is in Debian (see other forum entry)

  2. I am still not able to send UDP data. Calling the “beginPacket” method returns 1 (success), writing data returns the correct amount of data (success) and endPacket return 0 (failure).

When looking into the arduino code I figured out, that this it seems to be the case when the W5100 module reports a timeout. But there should not be a timeout for UDP?! So it must be something different I guess.

I hope somebody can help.

Thanks in advance.

Well after some debugging with wireshark I finally found out that it was actually my own fault:

From Arduino Version pre1.0 to 1.0 the Ethernet.begin calls changed. I previously called:

void setup() {
  Ethernet.begin(mac, ip, gateway, subnet);

Which actually calls:

Ethernet.begin ( mac, ip, dnsserver, gateway );

Which triggered Arduino to send the UDP reply to "" since I am on a class B network.

Changing the call to:

Ethernet.begin(mac, ip, gateway, gateway, subnet);

worked for me, since the gateway is also the DNS server.