client's ip

Just wandering if there's an easy way using the w5100 or w5500 to get the client's ip? I think its time to filter malicious requests to my server ... and I dont feel like patching libraries.

IPAddress clientIP=client.remoteIP();

gives

class EthernetClient' has no member named 'remoteIP'

In my version of the Ethernet library the EthernetClient class has a method called remoteIP() and a test sketch compiles without an error. Post your code!

Need to prepare a minimal version

finally the full version.

to find global server related search ///server
to find the server search //server
Thanks

_98.ino (137 KB)

Learn to format code or let the IDE do it (Tools->Auto Format)! Unfortunately the Auto Format option doesn't split multi-command lines.

If I try to compile that code the M2S_* is missing.

I'm quite sure you have several Ethernet libraries installed and the IDE is choosing a wrong one. Enable verbose output during compilation (in Preferences) to see such conflicts.

I am really sorry Pylon! I uploaded the wrong libs zip. Here is the good one
as for the compilation, it’s in verbose. attaching the pasted compiler’s output (to the screen) text

libraries.zip (251 KB)

pasted_comp_out.txt (70 KB)

The short answer:

client.remoteIP() works with enet lib 2.0.0 and up.