* The sockaddr_dl can actually be longer than sockaddr, so we need to use a

sockaddr_storage here (wasn't that bad before, as ifreq has a 30 bytes buffer
  after the sockaddr.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37940 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2010-08-06 12:55:51 +00:00
parent ab7c7773b2
commit 8b6048a285

View File

@ -422,11 +422,12 @@ link_control(net_protocol* _protocol, int level, int option, void* value,
if (interface == NULL)
return B_DEVICE_NOT_FOUND;
get_device_interface_address(interface, &request.ifr_addr);
sockaddr_storage address;
get_device_interface_address(interface, (sockaddr*)&address);
put_device_interface(interface);
return user_memcpy(&((struct ifreq*)value)->ifr_addr,
&request.ifr_addr, request.ifr_addr.sa_len);
&address, address.ss_len);
}
case SIOCGIFFLAGS: