pin / tftp

TFTP server and client library for Golang
MIT License
287 stars 71 forks source link

Make the server side send packets from the same IP address it recieve… #58

Closed VictorLowther closed 3 years ago

VictorLowther commented 4 years ago

…d them on.

If you have an interface with multiple IP addresses in the same subnet bound to it, the server code opens a listen socket on all addresses to communicate back to the client, which can cause the kernel to send packets back to the client from a different IP address than the client sent its initial request to. Most of the commandline TFTP clients don't care, but several of the ones embedded in NIC firmware do. To fix that, have the server side code open its client-specific listen socket on the address it recieved the incoming request on.

qin-nz commented 3 years ago

@pin Please merge this.

qin-nz commented 3 years ago

For anyone who cares this, you can use following steps before merged.

step 1:

go get github.com/pin/tftp
go mod download github.com/digitalrebar/tftp

step 2: add replace in your go.mod, it should looks like:

module yourmodelname

go 1.16

require (
    github.com/pin/tftp v2.1.0+incompatible
)

replace github.com/pin/tftp v2.1.0+incompatible => github.com/digitalrebar/tftp v0.0.0-20200914190809-39d58dc90c67
pin commented 3 years ago

LGTM! Sorry for the delay!

qin-nz commented 3 years ago

@pin Please make a release of just add a new tag v2.1.1. Go will use the highest version as the latest version. That means v2.1.0 is newer than the latest v0.0.0-20210809155059-0161c5dd2e96.

pin commented 3 years ago

I've just made v.2.2.0 - assuming that will also work. Please let me know if that is not enough.