Bug 11174 – Both AF_PACKET and SO_BINDTODEVICE undefined

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2013-10-05T07:50:09Z
Last change time
2018-10-18T05:26:18Z
Assigned to
No Owner
Creator
daniel

Comments

Comment #0 by daniel350 — 2013-10-05T07:50:09Z
AF_PACKET and SO_BINDTODEVICE are both undefined in any/all of the socket modules. Although they are not standard, they should still be available on platforms that support them. Their definitions (at least on my platform) are the following: AF_PACKET = 17; SO_BINDTODEVICE = 25;
Comment #1 by daniel350 — 2013-10-05T20:08:23Z
(In reply to comment #0) > AF_PACKET and SO_BINDTODEVICE are both undefined in any/all of the socket > modules. > Although they are not standard, they should still be available on platforms > that support them. > > Their definitions (at least on my platform) are the following: > > AF_PACKET = 17; > SO_BINDTODEVICE = 25; These constants can be found (at least in my machine), at the following location: `/usr/include/bits/socket.h`. Also, all of the `/usr/include/linux/if_ether.h` constants would be very useful for this also. Such as (in my case) ETH_P_ALL. Offhand reference: http://www.scs.stanford.edu/histar/src/uinc/linux/if_ether.h It almost feels like we just need to have a way of automatically merging these constants into the appropriate D files...
Comment #2 by github-bugzilla — 2018-10-18T05:26:17Z
Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/d7b855a0f816b9e376ecfb187dd618be90a8d8d7 Fix Issue 11174 - Define non-standard address family and socket option values for Linux https://github.com/dlang/druntime/commit/6c3880967b7673534575b567c310173e147baf08 Merge pull request #2327 from ibuclaw/issue11174 Fix Issue 11174 - Define non-standard address family and socket option values for Linux merged-on-behalf-of: Nathan Sashihara <[email protected]>