# How to add SO_BINDTODEVICE option support in FreeBSD stack



## Aymen (Jun 25, 2013)

I am implementing a code based on raw sockets. In order to receive _in_coming _E_thernet frames I have to bind the socket I created to an _E_thernet interface (eth0 for instance). The only way to do that, as far as I am concerned, is via _the_ setsockopt() function with the option SO_BINDTODEVICE.

The problem is that _the_ FreeBSD stack does not support that option. Is there any patch to apply in order to enable this feature or any other trusted alternatives to try?


----------

