openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/libnl/1_3.4.0-r0/libnl-3.4.0/lib/socket.c
int nl_socket_recv_pktinfo(struct nl_sock* sk, int state)
{
    int err;

    if (sk->s_fd == -1)
        return -NLE_BAD_SOCK;

    err = setsockopt(sk->s_fd, SOL_NETLINK, NETLINK_PKTINFO, &state,
                     sizeof(state));
    if (err < 0)
    {
        NL_DBG(4,
               "nl_socket_recv_pktinfo(%p): setsockopt() failed with %d (%s)\n",
               sk, errno, nl_strerror_l(errno));
        return -nl_syserr2nlerr(errno);
    }

    return 0;
}
/**
 * Enable/disable receival of additional packet information
 * @arg sk		Netlink socket.
 * @arg state		New state (0 - disabled, 1 - enabled)
 *
 * @return 0 on success or a negative error code
 */
Enable/disable receival of additional packet information
@arg sk              Netlink socket.
@arg state           New state (0 - disabled, 1 - enabled)

@return 0 on success or a negative error code
Enable / disable receival of additional packet information @arg sk Netlink socket . @arg state New state ( 0 - disabled 1 - enabled ) @return 0 on success or a negative error code
int nl_socket_recv_pktinfo(struct nl_sock* sk, int state)
{
    int err;
    if (sk->s_fd == -1)
        return -NLE_BAD_SOCK;
    err = setsockopt(sk->s_fd, SOL_NETLINK, NETLINK_PKTINFO, &state,
                     sizeof(state));
    if (err < 0)
    {
        NL_DBG(4,
               "nl_socket_recv_pktinfo(%p): setsockopt() failed with %d (%s)\n",
               sk, errno, nl_strerror_l(errno));
        return -nl_syserr2nlerr(errno);
    }
    return 0;
}
int nl_socket_recv_pktinfo ( struct nl_sock * sk , int state ) { int err ; if ( sk -> s_fd == -1 ) return - NLE_BAD_SOCK ; err = setsockopt ( sk -> s_fd , SOL_NETLINK , NETLINK_PKTINFO , & state , sizeof ( state ) ) ; if ( err < 0 ) { NL_DBG ( 4 , " \n " , sk , errno , nl_strerror_l ( errno ) ) ; return - nl_syserr2nlerr ( errno ) ; } return 0 ; }
Enable/disable receival of additional packet information
 @arg sk              Netlink socket.
Enable / disable receival of additional packet information @arg sk Netlink socket .