Support RTPROT_KERNEL when adding/deleting routes
authorSamuel Ortiz <sameo@linux.intel.com>
Tue, 18 May 2010 10:18:13 +0000 (12:18 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 18 May 2010 14:35:02 +0000 (16:35 +0200)
RTM_*ROUTE messages can come with an RTPROT_KERNEL protocol when setting
route after bringing the interface up.

src/rtnl.c

index 12ebdcb..147d2da 100644 (file)
@@ -790,7 +790,8 @@ static void rtnl_newroute(struct nlmsghdr *hdr)
        rtnl_route(hdr);
 
        if (msg->rtm_table == RT_TABLE_MAIN &&
-                               msg->rtm_protocol == RTPROT_BOOT &&
+               (msg->rtm_protocol == RTPROT_BOOT ||
+                       msg->rtm_protocol == RTPROT_KERNEL) &&
                                                msg->rtm_type == RTN_UNICAST)
                process_newroute(msg->rtm_family, msg->rtm_scope,
                                                msg, RTM_PAYLOAD(hdr));
@@ -803,7 +804,8 @@ static void rtnl_delroute(struct nlmsghdr *hdr)
        rtnl_route(hdr);
 
        if (msg->rtm_table == RT_TABLE_MAIN &&
-                               msg->rtm_protocol == RTPROT_BOOT &&
+               (msg->rtm_protocol == RTPROT_BOOT ||
+                       msg->rtm_protocol == RTPROT_KERNEL) &&
                                                msg->rtm_type == RTN_UNICAST)
                process_delroute(msg->rtm_family, msg->rtm_scope,
                                                msg, RTM_PAYLOAD(hdr));