Commit Graph

15 Commits

Author SHA1 Message Date
James Hartig 032fbabc82 Correctly set the Source IP to the received Destination IP (#524)
Previously, the oob data was just stored and sent to WriteMsgUDP but it
ignores the Src field when writing. Instead, now it is setting the Src
to the original Dst and handling IPv4 IPs over IPv6 correctly.
2017-09-29 10:38:26 +01:00
Andrew Brampton dadd480c0d Refactored the udp*.go files, to remove redundancy, and to make them compile for Go on App Engine. (#451)
App Engine even though is Linux, does not allow referencing the syscall package. Thus I reorganised
the udp*.go files a little to make this work. As best I can the functionality is unchanged, and all
this continues to compiles on darwin, linux, windows, plan9 and appengine.

Namely:
* Moved all Linux specific code from udp.go into udp_linux.go (e.g setUDPSocketOptions)
* Deleted udp_plan9.go which was almost a copy of udp.go.
* Added build tags to stop appengine using the linux build, and instead using the udp_other.go.
2017-02-13 09:42:34 +00:00
Diep Pham 78bb99c423 adds tests for shutdown bind port (#400)
* adds tests for shutdown bind port

* closes file descriptors in for udp on linux

* adds sleep after shutdown in test

* minimizes defer usages

* reduces sleep time

* replaces sleep with notify channel

after starting DNS server
2016-12-15 16:20:35 +00:00
Ryan Leavengood 7b51cba64a Set UDP conn to non-blocking on Linux to fix Shutdown()
The call to conn.File() causes Go to call dup() and then set the resulting FD
to be blocking. This sets the FD back to non-blocking, allowing Shutdown() to
work properly.

Fixes #279.
2015-12-01 17:15:42 -05:00
Miek Gieben 0aa3021a83 Remove all copyright notices
Use the central COPYRIGHT file.
2014-09-11 20:57:37 +01:00
Miek Gieben e571f699d2 Move more syscall function into their own impl.
Windows is stupid
2014-07-11 08:47:49 +00:00
Miek Gieben 907e91be57 udp: Windows: abstract the GetSocketOption away too.
Windows is weird, put this stuff in the impl. specific sub file too.
2014-07-11 08:13:05 +01:00
Miek Gieben 20ddea5ac9 even shorter 2014-07-09 21:06:42 +01:00
Miek Gieben d161b9087e Cleanup the PR a bit
Remove code and simplify some functions. Documentation is still on the
todo.
Also don't export any of these functions and/or types.
2014-07-09 21:02:21 +01:00
Miek Gieben 97b62e4aff Cleanup the pull request somewhat 2014-07-09 20:07:23 +01:00
Omri Bahumi 0ef26ca4b8 [ISSUE-95] Added copyright notice to udp.go, udp_linux.go & udp_other.go 2014-07-08 17:44:36 +03:00
Omri Bahumi aea5c1da03 [ISSUE-95] Patch only relevant stacks (v4, v6, dual) 2014-07-08 15:18:33 +03:00
Omri Bahumi 44f988ea86 [ISSUE-95] Added some documentation for the new UDP implementation 2014-07-08 11:42:02 +03:00
Omri Bahumi 4fb9d5f005 [ISSUE-95] Fixed IPv6 handling, reduced OOB buffer size to 40 bytes 2014-07-08 00:19:51 +03:00
Omri Bahumi dea4cb300a [ISSUE-95] Send replies from the right source IP address
Fixes #95
2014-07-07 18:16:42 +03:00