Skip to content

Commit 41c9c1f

Browse files
committed
UCS/NETLINK: code review fixes
1 parent 37f3128 commit 41c9c1f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ucs/sys/netlink.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,12 @@ ucs_netlink_get_route_info(const struct rtattr *rta, int len, int *if_index_p,
184184
for (; RTA_OK(rta, len); rta = RTA_NEXT(rta, len)) {
185185
if (rta->rta_type == RTA_OIF) {
186186
*if_index_p = *((const int *)RTA_DATA(rta));
187-
} else if ((rta->rta_type == RTA_DST) || (rta->rta_type == RTA_GATEWAY)) {
187+
} else if (rta->rta_type == RTA_DST) {
188188
*dst_in_addr = RTA_DATA(rta);
189189
}
190190
}
191191

192-
if ((*if_index_p == -1) || (*dst_in_addr == NULL)) {
192+
if ((*if_index_p == -1) || ((*dst_in_addr == NULL) && (rtm_dst_len != 0))) {
193193
return UCS_ERR_INVALID_PARAM;
194194
}
195195

@@ -272,7 +272,7 @@ static void ucs_netlink_lookup_route(ucs_netlink_route_info_t *info)
272272
continue;
273273
}
274274

275-
if (is_default_gw || ucs_sockaddr_is_same_subnet(
275+
if (ucs_sockaddr_is_same_subnet(
276276
info->sa_remote,
277277
(const struct sockaddr *)&curr_entry->dest,
278278
curr_entry->subnet_prefix_len)) {

0 commit comments

Comments
 (0)