fix parsing of sockaddr entries returned by routing socket on BSD

This commit is contained in:
Daniel Becker 2015-11-16 17:34:42 -08:00 committed by Thomas Bernard
parent 5cfa875477
commit 7ab525700d
1 changed files with 2 additions and 2 deletions

View File

@ -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);
} }
} }
} }