3

How do I check that packet socket support has been compiled into my kernel? I'm running Crunchbang, a Debian-based distribution.

GAD3R
  • 63,407
  • 31
  • 131
  • 192
user34789
  • 75
  • 2
  • 7

1 Answers1

5

Most Linux distributions include the config parameters used to compile the kernel in /boot/config-<kernel-version>.

So

grep -x 'CONFIG_PACKET=[ym]' "/boot/config-$(uname -r)"

Should tell you if AF_PACKET socket support is included (m for as a module).

Otherwise, you can just try and create a socket (using socket(2), see packet(7) for how to do it) in the AF_PACKET family and check if reports an error.

Stéphane Chazelas
  • 522,931
  • 91
  • 1,010
  • 1,501