mirror of
https://github.com/systemd/systemd
synced 2024-10-15 12:34:37 +00:00
socket-util: make socket_set_recvpktinfo control PACKET_AUXDATA sockopt on AF_PACKET
Just for the sake of completness.
This commit is contained in:
parent
c758bea722
commit
2d6d4136cd
|
@ -697,10 +697,11 @@
|
|||
<varlistentry>
|
||||
<term><varname>PassPacketInfo=</varname></term>
|
||||
<listitem><para>Takes a boolean value. This controls the <constant>IP_PKTINFO</constant>,
|
||||
<constant>IPV6_RECVPKTINFO</constant> and <constant>NETLINK_PKTINFO</constant> socket options, which
|
||||
enable reception of additional per-packet metadata as ancillary message, on
|
||||
<constant>AF_INET</constant>, <constant>AF_INET6</constant> and <constant>AF_UNIX</constant> sockets.
|
||||
Defaults to <option>false</option>.</para></listitem>
|
||||
<constant>IPV6_RECVPKTINFO</constant>, <constant>NETLINK_PKTINFO</constant> or
|
||||
<constant>PACKET_AUXDATA</constant> socket options, which enable reception of additional per-packet
|
||||
metadata as ancillary message, on <constant>AF_INET</constant>, <constant>AF_INET6</constant>,
|
||||
<constant>AF_UNIX</constant> and <constant>AF_PACKET</constant> sockets. Defaults to
|
||||
<option>false</option>.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
|
|
|
@ -1240,6 +1240,9 @@ int socket_set_recvpktinfo(int fd, int af, bool b) {
|
|||
case AF_NETLINK:
|
||||
return setsockopt_int(fd, SOL_NETLINK, NETLINK_PKTINFO, b);
|
||||
|
||||
case AF_PACKET:
|
||||
return setsockopt_int(fd, SOL_PACKET, PACKET_AUXDATA, b);
|
||||
|
||||
default:
|
||||
return -EAFNOSUPPORT;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue