netlink_netfilter bind failure
Hello,
I am trying to create small user space application to listen for
netfilter configuration message. Following is the snapshot of my code. I am getting a bind failure (Operation not permitted error) when I try to bind socket to specific netlink messages. Can someone please help me here ?
nlSocketId = socket(PF_NETLINK, SOCK_RAW, NETLINK_NETFILTER); if (nlSocketId == -1)
perror("socket create failure\n");memset(&nlSockAddr, 0x00, sizeof(nlSockAddr)); nlSockAddr.nl_family = AF_NETLINK; nlSockAddr.nl_groups = NFNLGRP_CONNTRACK_NEW; if ( bind(nlSocketId, (struct sockaddr *) &nlSockAddr, sizeof(nlSockAddr)) == -1)
{
perror("bind failure");
}
-NP