Bug 100081

Summary: sll_family required for bind() on AF_PACKET socket
Product: Documentation Reporter: janh (a0vhv)
Component: man-pagesAssignee: documentation_man-pages (documentation_man-pages)
Status: RESOLVED PATCH_ALREADY_AVAILABLE    
Severity: normal CC: mtk.manpages
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

Description janh 2015-06-17 22:34:15 UTC
This is from "man 7 packet":
>When you send packets it is enough to specify sll_family, sll_addr, sll_halen,
>sll_ifindex.  The other fields should be 0. sll_hatype and sll_pkttype are set
>on received packets for your information. For bind only sll_protocol and
>sll_ifindex are used.

However, the last sentence is not correct. You have to specifiy sll_family for bind() too, otherwise it will fail.
Comment 1 Michael Kerrisk 2015-06-18 06:42:51 UTC
By chance, this was actually reported and fixed a few weeks ago, and the text that will appear in the next man-pages release is:

       Fields used for binding are sll_family (should be
       AF_PACKET), sll_protocol, and sll_ifindex.