Ignore:
Timestamp:
Nov 4, 2007, 3:16:40 AM (17 years ago)
Author:
Bruno Cornec
Message:

Update to busybox 1.7.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mindi-busybox/networking/udhcp/static_leases.c

    r821 r1765  
     1/* vi: set sw=4 ts=4: */
    12/*
    23 * static_leases.c -- Couple of functions to assist with storing and
     
    78 */
    89
     10#include "common.h"
     11#include "dhcpd.h"
    912
    10 #include <stdlib.h>
    11 #include <stdio.h>
    12 #include <string.h>
    13 
    14 #include "static_leases.h"
    15 #include "dhcpd.h"
    1613
    1714/* Takes the address of the pointer to the static_leases linked list,
     
    2017int addStaticLease(struct static_lease **lease_struct, uint8_t *mac, uint32_t *ip)
    2118{
    22 
    2319    struct static_lease *cur;
    2420    struct static_lease *new_static_lease;
     
    3127
    3228    /* If it's the first node to be added... */
    33     if(*lease_struct == NULL)
    34     {
     29    if (*lease_struct == NULL) {
    3530        *lease_struct = new_static_lease;
    36     }
    37     else
    38     {
     31    } else {
    3932        cur = *lease_struct;
    40         while(cur->next != NULL)
    41         {
     33        while (cur->next) {
    4234            cur = cur->next;
    4335        }
     
    4739
    4840    return 1;
    49 
    5041}
    5142
     
    5950    return_ip = 0;
    6051
    61     while(cur != NULL)
    62     {
     52    while (cur) {
    6353        /* If the client has the correct mac  */
    64         if(memcmp(cur->mac, mac, 6) == 0)
    65         {
     54        if (memcmp(cur->mac, mac, 6) == 0) {
    6655            return_ip = *(cur->ip);
    6756        }
     
    7160
    7261    return return_ip;
    73 
    7462}
    7563
     
    8169    uint32_t return_val = 0;
    8270
    83     while(cur != NULL)
    84     {
     71    while (cur) {
    8572        /* If the client has the correct ip  */
    86         if(*cur->ip == ip)
     73        if (*cur->ip == ip)
    8774            return_val = 1;
    8875
     
    9178
    9279    return return_val;
    93 
    9480}
    9581
    96 #ifdef CONFIG_FEATURE_UDHCP_DEBUG
     82#if ENABLE_FEATURE_UDHCP_DEBUG
    9783/* Print out static leases just to check what's going on */
    9884/* Takes the address of the pointer to the static_leases linked list */
     
    10288    struct static_lease *cur = *arg;
    10389
    104     while(cur != NULL)
    105     {
     90    while (cur) {
    10691        /* printf("PrintStaticLeases: Lease mac Address: %x\n", cur->mac); */
    10792        printf("PrintStaticLeases: Lease mac Value: %x\n", *(cur->mac));
     
    11196        cur = cur->next;
    11297    }
    113 
    114 
    11598}
    11699#endif
    117 
    118 
    119 
Note: See TracChangeset for help on using the changeset viewer.