fix parsing of sockaddr entries returned by routing socket on BSD
This commit is contained in:
parent
5cfa875477
commit
7ab525700d
|
@ -96,7 +96,7 @@ get_src_for_route_to(const struct sockaddr * dst,
|
||||||
sa = (struct sockaddr *)p;
|
sa = (struct sockaddr *)p;
|
||||||
sockaddr_to_string(sa, tmp, sizeof(tmp));
|
sockaddr_to_string(sa, tmp, sizeof(tmp));
|
||||||
syslog(LOG_DEBUG, "type=%d sa_len=%d sa_family=%d %s",
|
syslog(LOG_DEBUG, "type=%d sa_len=%d sa_family=%d %s",
|
||||||
i, SA_LEN(sa), sa->sa_family, tmp);
|
i, sa->sa_len, sa->sa_family, tmp);
|
||||||
if(i == RTA_DST || i == RTA_GATEWAY) {
|
if(i == RTA_DST || i == RTA_GATEWAY) {
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
void * paddr = NULL;
|
void * paddr = NULL;
|
||||||
|
@ -127,7 +127,7 @@ get_src_for_route_to(const struct sockaddr * dst,
|
||||||
*index = sdl->sdl_index;
|
*index = sdl->sdl_index;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
p += SA_LEN(sa);
|
p += SA_SIZE(sa);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue