File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -908,15 +908,16 @@ int netlink_get_neighbors(int family,
908
908
continue ;
909
909
}
910
910
911
- unsigned int rtalen = len ;
912
- for (nlh = (struct nlmsghdr * )buf ; NLMSG_OK (nlh , rtalen ); nlh = NLMSG_NEXT (nlh , rtalen )) {
911
+ int nlh_len = len ;
912
+ for (nlh = (struct nlmsghdr * )buf ; NLMSG_OK (nlh , nlh_len ); nlh = NLMSG_NEXT (nlh , nlh_len )) {
913
913
ndm = NLMSG_DATA (nlh );
914
914
struct rtattr * rta = RTM_RTA (ndm );
915
915
const uint8_t * mac = NULL ;
916
916
const uint8_t * net_addr = NULL ;
917
917
int net_addr_len = 0 ;
918
+ int rta_len = RTM_PAYLOAD (nlh );
918
919
919
- for (; RTA_OK (rta , rtalen ); rta = RTA_NEXT (rta , rtalen )) {
920
+ for (; RTA_OK (rta , rta_len ); rta = RTA_NEXT (rta , rta_len )) {
920
921
if (rta -> rta_type == NDA_DST ) {
921
922
if (ndm -> ndm_family == AF_INET ) {
922
923
struct in_addr * addr = RTA_DATA (rta );
You can’t perform that action at this time.
0 commit comments