Getting ip address of of source in server #197
-
I'm working on ACCEPT part of the code, and I figured out it is hard to find the ip address of the client. TCP packets doesn't contain informations of ip address. and the following Tip: Figuring out the source IP address to use (https://github.com/ANLAB-KAIST/KENSv3/wiki/Tip:-Figuring-out-the-source-IP-address-to-use) was not helpful, because I found this method doesn't work on finding address of source. But anyway accept function should return the address of client. I wonder how? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The |
Beta Was this translation helpful? Give feedback.
The
packet
ofpacketArrived()
contains all addresses including MAC and IP. You can parse thepacket
to retrieve source IP address.