|
Lines 228-233
static int initial_setup_interface(char * device, int s) {
Link Here
|
| 228 |
return 0; |
228 |
return 0; |
| 229 |
} |
229 |
} |
| 230 |
|
230 |
|
|
|
231 |
static int interface_cleanup(char * device, int s) { |
| 232 |
/* |
| 233 |
* Removing the auxiliary route |
| 234 |
* made by initial_setup_interface() |
| 235 |
*/ |
| 236 |
struct rtentry route; |
| 237 |
struct sockaddr_in* address; |
| 238 |
|
| 239 |
memset(&route, 0, sizeof(route)); |
| 240 |
|
| 241 |
route.rt_dev = device; |
| 242 |
route.rt_flags = RTF_UP | RTF_GATEWAY; |
| 243 |
route.rt_metric = 0; |
| 244 |
|
| 245 |
address = &route.rt_dst; |
| 246 |
address->sin_family = AF_INET; |
| 247 |
|
| 248 |
address = &route.rt_gateway; |
| 249 |
address->sin_family = AF_INET; |
| 250 |
|
| 251 |
address = &route.rt_genmask; |
| 252 |
address->sin_family = AF_INET; |
| 253 |
|
| 254 |
if (ioctl(s, SIOCDELRT, &route)) { |
| 255 |
close(s); |
| 256 |
log_perror("SIOCDELRT"); |
| 257 |
return -1; |
| 258 |
} |
| 259 |
|
| 260 |
return 0; |
| 261 |
} |
| 231 |
|
262 |
|
| 232 |
void set_missing_ip_info(struct interface_info * intf) |
263 |
void set_missing_ip_info(struct interface_info * intf) |
| 233 |
{ |
264 |
{ |
|
Lines 669-674
enum return_type perform_dhcp(struct interface_info * intf)
Link Here
|
| 669 |
} |
700 |
} |
| 670 |
lease = ntohl(lease); |
701 |
lease = ntohl(lease); |
| 671 |
|
702 |
|
|
|
703 |
interface_cleanup(intf->device, s); |
| 672 |
close(s); |
704 |
close(s); |
| 673 |
free(vendorClass); |
705 |
free(vendorClass); |
| 674 |
|
706 |
|
| 675 |
- |
|
|