sync busybox and udhcp trees

This commit is contained in:
Mike Frysinger 2006-03-23 03:05:05 +00:00
parent e1d41b3102
commit 13c8327b79
7 changed files with 21 additions and 14 deletions

View File

@ -469,6 +469,7 @@ int main(int argc, char *argv[])
(unsigned long) packet.xid, xid); (unsigned long) packet.xid, xid);
continue; continue;
} }
/* Ignore packets that aren't for us */ /* Ignore packets that aren't for us */
if (memcmp(packet.chaddr, client_config.arp, 6)) { if (memcmp(packet.chaddr, client_config.arp, 6)) {
DEBUG(LOG_INFO, "packet does not have our chaddr -- ignoring"); DEBUG(LOG_INFO, "packet does not have our chaddr -- ignoring");

View File

@ -2,9 +2,8 @@
#ifndef _DHCPC_H #ifndef _DHCPC_H
#define _DHCPC_H #define _DHCPC_H
#ifndef DEFAULT_SCRIPT /* grab define DEFAULT_SCRIPT */
#define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script" #include "libbb_udhcp.h"
#endif
#define INIT_SELECTING 0 #define INIT_SELECTING 0
#define REQUESTING 1 #define REQUESTING 1

View File

@ -1,6 +1,6 @@
/* vi: set sw=4 ts=4: */ /* vi: set sw=4 ts=4: */
/* /*
Licensed under the GPL v2 or later, see the file LICENSE in this tarball. * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
*/ */
#include <fcntl.h> #include <fcntl.h>
#include <string.h> #include <string.h>

View File

@ -139,6 +139,7 @@ static void attach_option(struct option_set **opt_list, struct dhcp_option *opti
} }
} }
/* read a dhcp option and add it to opt_list */ /* read a dhcp option and add it to opt_list */
static int read_opt(const char *const_line, void *arg) static int read_opt(const char *const_line, void *arg)
{ {

View File

@ -3,14 +3,15 @@
/* bit of a hack, do this no matter what the order of the includes. /* bit of a hack, do this no matter what the order of the includes.
* (for busybox) */ * (for busybox) */
#ifdef CONFIG_INSTALL_NO_USR
#undef DEFAULT_SCRIPT
#define DEFAULT_SCRIPT "/share/udhcpc/default.script"
#endif
#ifndef _LIBBB_UDHCP_H #ifndef _LIBBB_UDHCP_H
#define _LIBBB_UDHCP_H #define _LIBBB_UDHCP_H
#ifdef CONFIG_INSTALL_NO_USR
# define DEFAULT_SCRIPT "/share/udhcpc/default.script"
#else
# define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script"
#endif
#ifdef IN_BUSYBOX #ifdef IN_BUSYBOX
#include "busybox.h" #include "busybox.h"
@ -56,12 +57,20 @@
/* from dhcpd.h */ /* from dhcpd.h */
#define server_config udhcp_server_config #define server_config udhcp_server_config
#else /* ! BB_VER */ #else /* ! IN_BUSYBOX */
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#ifndef ATTRIBUTE_NORETURN
#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
#endif /* ATTRIBUTE_NORETURN */
#ifndef ATTRIBUTE_PACKED
#define ATTRIBUTE_PACKED __attribute__ ((__packed__))
#endif /* ATTRIBUTE_PACKED */
#define TRUE 1 #define TRUE 1
#define FALSE 0 #define FALSE 0
@ -78,6 +87,6 @@ static inline FILE *xfopen(const char *file, const char *mode)
return fp; return fp;
} }
#endif /* BB_VER */ #endif /* IN_BUSYBOX */
#endif /* _LIBBB_UDHCP_H */ #endif /* _LIBBB_UDHCP_H */

View File

@ -170,4 +170,3 @@ int add_simple_option(uint8_t *optionptr, uint8_t code, uint32_t data)
DEBUG(LOG_ERR, "Could not add option 0x%02x", code); DEBUG(LOG_ERR, "Could not add option 0x%02x", code);
return 0; return 0;
} }

View File

@ -50,7 +50,6 @@ int get_packet(struct dhcpMessage *packet, int fd)
"MSFT 98", "MSFT 98",
"" ""
}; };
int bytes; int bytes;
int i; int i;
char unsigned *vendor; char unsigned *vendor;
@ -79,7 +78,6 @@ int get_packet(struct dhcpMessage *packet, int fd)
} }
} }
return bytes; return bytes;
} }