- style fixes

This commit is contained in:
Bernhard Reutner-Fischer 2006-11-21 11:23:11 +00:00
parent 1288722f3e
commit a8381948da

View File

@ -21,7 +21,7 @@
/* This list holds information about clients. The xid_* functions manipulate this list. */
struct xid_item {
static struct xid_item {
u_int32_t xid;
struct sockaddr_in ip;
int client;
@ -133,15 +133,16 @@ static void dhcprelay_signal_handler(int sig)
static char ** get_client_devices(char *dev_list, int *client_number)
{
char *s, *list, **client_dev;
int i, cn=1;
int i, cn;
/* copy list */
list = xstrdup(dev_list);
if (list == NULL) return NULL;
/* get number of items */
for (s = dev_list; *s; s++) if (*s == ',')
cn++;
for (s = dev_list, cn = 1; *s; s++)
if (*s == ',')
cn++;
client_dev = xzalloc(cn * sizeof(*client_dev));
@ -166,16 +167,16 @@ static int init_sockets(char **client, int num_clients,
{
int i;
// talk to real server on bootps
/* talk to real server on bootps */
fds[0] = listen_socket(htonl(INADDR_ANY), 67, server);
if (fds[0] < 0) return -1;
*max_socket = fds[0];
// array starts at 1 since server is 0
/* array starts at 1 since server is 0 */
num_clients++;
for (i=1; i < num_clients; i++) {
// listen for clients on bootps
/* listen for clients on bootps */
fds[i] = listen_socket(htonl(INADDR_ANY), 67, client[i-1]);
if (fds[i] < 0) return -1;
if (fds[i] > *max_socket) *max_socket = fds[i];