make a 'runtests' make target that runs some 'unit test'-like tests. Fix crash when uid's without a password entry are encountered, return the uid as a string instead.
This commit is contained in:
13
packet.cpp
13
packet.cpp
@@ -60,13 +60,14 @@ void getLocal (const char *device, bool tracemode)
|
||||
struct ifreq iFreq;
|
||||
struct sockaddr_in *saddr;
|
||||
|
||||
if((sock=socket(AF_INET, SOCK_RAW, htons(0x0806)))<0){
|
||||
forceExit("creating socket failed while establishing local IP - are you root?", -3);
|
||||
}
|
||||
if((sock=socket(AF_INET, SOCK_RAW, htons(0x0806)))<0)
|
||||
forceExit(false, "creating socket failed while establishing local IP - are you root?");
|
||||
|
||||
strcpy(iFreq.ifr_name, device);
|
||||
if(ioctl(sock, SIOCGIFADDR, &iFreq)<0){
|
||||
forceExit("ioctl failed while establishing local IP for selected device %s. You may specify the device on the command line.", -4, device);
|
||||
}
|
||||
|
||||
if(ioctl(sock, SIOCGIFADDR, &iFreq)<0)
|
||||
forceExit(false, "ioctl failed while establishing local IP for selected device %s. You may specify the device on the command line.", device);
|
||||
|
||||
saddr=(struct sockaddr_in*)&iFreq.ifr_addr;
|
||||
local_addrs = new local_addr (saddr->sin_addr.s_addr, local_addrs);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user