Networking Forums

Networking Forums > Computer Networking > Linux Networking > netlink socket to receive route updates not working???

Reply
Thread Tools Display Modes

netlink socket to receive route updates not working???

 
 
Deepak
Guest
Posts: n/a

 
      09-29-2003, 09:40 AM
Hello,
If I write a program to use "netlink" sockets to receive route updates
and then add a static route, should i get that route update???
To be more precise,I have something like this

I open socket using
socket (AF_NETLINK, SOCK_RAW, NETLINK_ROUTE) call, and
then I use the "groups" as
groups = RTMGRP_LINK|RTMGRP_IPV4_ROUTE|RTMGRP_IPV4_IFADDR;
I do a sendto (netlink_sock_fd) with these
flags |= NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST

and then the receive function
while (1)
{
FD_SET(netlink_sock_fd, &rd);
status = select (2, &rd, NULL, NULL, NULL);
if (status < 0)
{
perror ("select()");
exit (1);
}
if (FD_ISSET (netlink_sock_fd, &rd))
{
status = recvmsg (netlink_sock_fd, &msg, 0);
// further processing from here.....
}
So, first time I get an entire routing table, which I print. But if I
add a static route while the program is running nothing happens!!
I expect the new "modified" routing table to get printed.
Any help in this would be really appreciated.
thanks,
deepak.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Test socket on Master Socket not working Kevin Cowans Broadband 14 11-15-2006 09:17 PM
How big is socket receive buffer, and how to control it? C. J. Clegg Linux Networking 1 04-30-2006 08:58 AM
How to get my local ethernet ip on which i receive a socket data?? kernel.lover Linux Networking 1 03-22-2005 08:41 AM
receive on socket with MSG_WAITALL flag Shanthi Paladugu Linux Networking 0 11-08-2004 04:31 PM
How to read all the route table entries using netlink sockets Sharanbasu Linux Networking 0 12-08-2003 09:42 AM



1 2 3 4 5 6 7 8 9 10 11