0

The netlink socket address structure is shown in the following,

struct sockaddr_nl
{
    sa_family_t nl_family;  /* AF_NETLINK   */
    unsigned short  nl_pad;     /* zero     */
    __u32       nl_pid;     /* process pid  */
    __u32       nl_groups;  /* multicast groups mask */
};

Two questions here:

  1. About the process id, does zero mean to root privilege and this means to process id?

  2. what does nl_groups mean? Does this mean I can configure this to do unicast?

Thanks

Sam
  • 4,521
  • 13
  • 46
  • 81

1 Answers1

1
  1. nl_pid is Port ID (see source) and it has nothing to do with privileges.
  2. nl_groups as commentary tolds is multicast groubps mask. Netlink messages can be sent unitcast(to given PID - port ID), multicast and broadcast withing given netlink family (e.g. netfilter, generic, etc.)
Alexander Dzyoba
  • 4,009
  • 1
  • 24
  • 29