Bug 100081
Summary: | sll_family required for bind() on AF_PACKET socket | ||
---|---|---|---|
Product: | Documentation | Reporter: | janh (a0vhv) |
Component: | man-pages | Assignee: | 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: |
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. |
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.