I am trying following simple program on ClearOS 7.3, 64 bit
Code:
#include <sys/socket.h>
#include <linux/netlink.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
int main()
{
int flags =0;
int bus = NETLINK_NETFILTER;
int sock_fd = socket(AF_NETLINK, SOCK_RAW | flags, bus);
if(sock_fd<0)
{
printf("\nsocket failed with error no = %d and error msg = %s\n",
errno, strerror(errno));
return -1;
}
printf("\nOP completed successfully..!\n");
return 0;
}
I am getting following error:
socket failed with error no = 93 and error msg = Protocol not supported
My OS details are:
ClearOS release 7.3.0 (Final)
Linux 3.10.0-514.26.2.v7.x86_64 #1 SMP Wed Jul 5 10:37:54 MDT 2017 x86_64 x86_64 x86_64 GNU/Linux
Please help.