Specifying a socketaddr is unnecessary when writing packets to a raw socket. According to packet(7) the supplied buffer should contain a physical-layer header. The sockaddr_ll is used for SOCK_DGRAM.
SOCK_RAW packets are passed to and from the device driver without any
changes in the packet data. When receiving a packet, the address is
still parsed and passed in a standard sockaddr_ll address structure.
When transmitting a packet, the user-supplied buffer should contain
the physical-layer header. That packet is then queued unmodified to
the network driver of the interface defined by the destination
address.
SOCK_DGRAM operates on a slightly higher level. The physical header
is removed before the packet is passed to the user. Packets sent
through a SOCK_DGRAM packet socket get a suitable physical-layer
header based on the information in the sockaddr_ll destination
address before they are queued.
Specifying a socketaddr is unnecessary when writing packets to a raw socket. According to packet(7) the supplied buffer should contain a physical-layer header. The
sockaddr_ll
is used forSOCK_DGRAM
.http://man7.org/linux/man-pages/man7/packet.7.html