mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-23 18:38:00 +00:00
Fix some bugs in the code to get arbitrarily long interface lists.
This commit is contained in:
parent
5b5fcc81df
commit
c573b39cfe
@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: discover.c,v 1.32 2000/09/04 22:27:41 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: discover.c,v 1.33 2000/09/29 18:12:16 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@ -79,7 +79,7 @@ void discover_interfaces (state)
|
|||||||
{
|
{
|
||||||
struct interface_info *tmp, *ip;
|
struct interface_info *tmp, *ip;
|
||||||
struct interface_info *last, *next;
|
struct interface_info *last, *next;
|
||||||
char buf [512];
|
char buf [2048];
|
||||||
struct ifconf ic;
|
struct ifconf ic;
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
int i;
|
int i;
|
||||||
@ -114,9 +114,9 @@ void discover_interfaces (state)
|
|||||||
log_fatal ("Can't create addrlist socket");
|
log_fatal ("Can't create addrlist socket");
|
||||||
|
|
||||||
/* Get the interface configuration information... */
|
/* Get the interface configuration information... */
|
||||||
gifconf_again:
|
|
||||||
ic.ifc_len = sizeof buf;
|
ic.ifc_len = sizeof buf;
|
||||||
ic.ifc_ifcu.ifcu_buf = (caddr_t)buf;
|
ic.ifc_ifcu.ifcu_buf = (caddr_t)buf;
|
||||||
|
gifconf_again:
|
||||||
i = ioctl(sock, SIOCGIFCONF, &ic);
|
i = ioctl(sock, SIOCGIFCONF, &ic);
|
||||||
|
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user