@@ -367,10 +367,14 @@ int __connman_ipconfig_newaddr(int index, int family, const char *label,
void __connman_ipconfig_deladdr(int index, int family, const char *label,
unsigned char prefixlen, const char *address);
void __connman_ipconfig_newroute(int index, int family, unsigned char scope,
- const char *dst, const char *gateway,
+ const char *dst,
+ unsigned char dst_prefixlen,
+ const char *gateway,
uint32_t table_id, uint32_t metric);
void __connman_ipconfig_delroute(int index, int family, unsigned char scope,
- const char *dst, const char *gateway,
+ const char *dst,
+ unsigned char dst_prefixlen,
+ const char *gateway,
uint32_t table_id, uint32_t metric);
void __connman_ipconfig_foreach(void (*function) (int index, void *user_data),
@@ -1038,7 +1038,9 @@ out:
}
void __connman_ipconfig_newroute(int index, int family, unsigned char scope,
- const char *dst, const char *gateway,
+ const char *dst,
+ unsigned char dst_prefixlen,
+ const char *gateway,
uint32_t table_id, uint32_t metric)
{
struct connman_ipdevice *ipdevice;
@@ -1100,9 +1102,9 @@ void __connman_ipconfig_newroute(int index, int family, unsigned char scope,
}
}
- connman_info("%s {add} route %s gw %s scope %u <%s> table %u <%s> "
+ connman_info("%s {add} route %s/%u gw %s scope %u <%s> table %u <%s> "
"metric %u",
- ifname, dst, gateway, scope, scope2str(scope),
+ ifname, dst, dst_prefixlen, gateway, scope, scope2str(scope),
table_id, __connman_inet_table2string(table_id), metric);
out:
@@ -1110,7 +1112,9 @@ out:
}
void __connman_ipconfig_delroute(int index, int family, unsigned char scope,
- const char *dst, const char *gateway,
+ const char *dst,
+ unsigned char dst_prefixlen,
+ const char *gateway,
uint32_t table_id, uint32_t metric)
{
struct connman_ipdevice *ipdevice;
@@ -1170,9 +1174,9 @@ void __connman_ipconfig_delroute(int index, int family, unsigned char scope,
}
}
- connman_info("%s {del} route %s gw %s scope %u <%s> table %u <%s> "
+ connman_info("%s {del} route %s/%u gw %s scope %u <%s> table %u <%s> "
"metric %u",
- ifname, dst, gateway, scope, scope2str(scope),
+ ifname, dst, dst_prefixlen, gateway, scope, scope2str(scope),
table_id, __connman_inet_table2string(table_id), metric);
out:
@@ -758,9 +758,10 @@ static void process_newroute(unsigned char family, unsigned char scope,
inet_ntop(family, &gateway, gatewaystr, sizeof(gatewaystr));
__connman_ipconfig_newroute(index, family, scope, dststr,
- gatewaystr,
- table_id,
- metric);
+ msg->rtm_dst_len,
+ gatewaystr,
+ table_id,
+ metric);
/* skip host specific routes */
if (scope != RT_SCOPE_UNIVERSE &&
@@ -781,9 +782,10 @@ static void process_newroute(unsigned char family, unsigned char scope,
inet_ntop(family, &gateway, gatewaystr, sizeof(gatewaystr));
__connman_ipconfig_newroute(index, family, scope, dststr,
- gatewaystr,
- table_id,
- metric);
+ msg->rtm_dst_len,
+ gatewaystr,
+ table_id,
+ metric);
/* skip host specific routes */
if (scope != RT_SCOPE_UNIVERSE &&
@@ -823,9 +825,10 @@ static void process_delroute(unsigned char family, unsigned char scope,
inet_ntop(family, &gateway, gatewaystr, sizeof(gatewaystr));
__connman_ipconfig_delroute(index, family, scope, dststr,
- gatewaystr,
- table_id,
- metric);
+ msg->rtm_dst_len,
+ gatewaystr,
+ table_id,
+ metric);
/* skip host specific routes */
if (scope != RT_SCOPE_UNIVERSE &&
@@ -846,9 +849,10 @@ static void process_delroute(unsigned char family, unsigned char scope,
inet_ntop(family, &gateway, gatewaystr, sizeof(gatewaystr));
__connman_ipconfig_delroute(index, family, scope, dststr,
- gatewaystr,
- table_id,
- metric);
+ msg->rtm_dst_len,
+ gatewaystr,
+ table_id,
+ metric);
/* skip host specific routes */
if (scope != RT_SCOPE_UNIVERSE &&
From: Grant Erickson <erick205@umn.edu> This adds support for extracting and passing the Routing Netlink (rtnl) destination prefix length to '__connman_ipconfig_{new,del}route' from 'process_{new,del}route'. --- src/connman.h | 8 ++++++-- src/ipconfig.c | 16 ++++++++++------ src/rtnl.c | 28 ++++++++++++++++------------ 3 files changed, 32 insertions(+), 20 deletions(-)