Implement the documented default listening behavior for TFTP.

This commit is contained in:
David Anderson 2016-02-27 16:35:03 -08:00
parent 7f4b62d890
commit 90c89c2bd7

View File

@ -71,6 +71,9 @@ type Server struct {
// calls Serve to handle TFTP requests. If addr is blank, ":69" is // calls Serve to handle TFTP requests. If addr is blank, ":69" is
// used. // used.
func (s *Server) ListenAndServe(addr string) error { func (s *Server) ListenAndServe(addr string) error {
if addr == "" {
addr = ":69"
}
l, err := net.ListenPacket("udp", addr) l, err := net.ListenPacket("udp", addr)
if err != nil { if err != nil {
return err return err