Skip to content

Instantly share code, notes, and snippets.

View surki's full-sized avatar

Suresh Kumar Ponnusamy surki

View GitHub Profile
@surki
surki / gist:4b1a3d8d40328712b6586e151a0813c5
Created September 26, 2017 12:19
Getting a socket's 'struct sock' information
You can get even more detailed information about a socket from kernel's internal socket struct.
For example, we will try to get nginx listening (on port 81) socket's backlog length
NOTE: You may need to install kernel debug info if not already installed
# yum-config-manager --enable "amzn-main-debuginfo" --enable "amzn-updates-debuginfo"
# yum -y install kernel-debuginfo kernel-devel
Or get socket info for listening socket on port 81
# ss -len | grep :81
tcp LISTEN 0 511 *:81 *:* ino:29842919 sk:55 <->