From: Lennart Poettering Date: Mon, 26 Oct 2020 15:19:24 +0000 (+0100) Subject: socket-util: make socket_set_recvpktinfo control PACKET_AUXDATA sockopt on AF_PACKET X-Git-Tag: v247-rc2~50^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2d6d4136cdad5cde1f7fa8b54e427383645ab5fe;p=thirdparty%2Fsystemd.git socket-util: make socket_set_recvpktinfo control PACKET_AUXDATA sockopt on AF_PACKET Just for the sake of completness. --- diff --git a/man/systemd.socket.xml b/man/systemd.socket.xml index a1e4284763b..8ec662c3acb 100644 --- a/man/systemd.socket.xml +++ b/man/systemd.socket.xml @@ -697,10 +697,11 @@ PassPacketInfo= Takes a boolean value. This controls the IP_PKTINFO, - IPV6_RECVPKTINFO and NETLINK_PKTINFO socket options, which - enable reception of additional per-packet metadata as ancillary message, on - AF_INET, AF_INET6 and AF_UNIX sockets. - Defaults to . + IPV6_RECVPKTINFO, NETLINK_PKTINFO or + PACKET_AUXDATA socket options, which enable reception of additional per-packet + metadata as ancillary message, on AF_INET, AF_INET6, + AF_UNIX and AF_PACKET sockets. Defaults to + . diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c index f2e1148e874..6f57b2a3c4c 100644 --- a/src/basic/socket-util.c +++ b/src/basic/socket-util.c @@ -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; }