From 13c8327b796862847f3682da2902381c39cf24ea Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 23 Mar 2006 03:05:05 +0000 Subject: sync busybox and udhcp trees --- networking/udhcp/dhcpc.c | 1 + networking/udhcp/dhcpc.h | 5 ++--- networking/udhcp/dumpleases.c | 2 +- networking/udhcp/files.c | 1 + networking/udhcp/libbb_udhcp.h | 23 ++++++++++++++++------- networking/udhcp/options.c | 1 - networking/udhcp/packet.c | 2 -- 7 files changed, 21 insertions(+), 14 deletions(-) (limited to 'networking') diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index 0c85eca..fe2225a 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c @@ -469,6 +469,7 @@ int main(int argc, char *argv[]) (unsigned long) packet.xid, xid); continue; } + /* Ignore packets that aren't for us */ if (memcmp(packet.chaddr, client_config.arp, 6)) { DEBUG(LOG_INFO, "packet does not have our chaddr -- ignoring"); diff --git a/networking/udhcp/dhcpc.h b/networking/udhcp/dhcpc.h index 80c3fc2..7c93f42 100644 --- a/networking/udhcp/dhcpc.h +++ b/networking/udhcp/dhcpc.h @@ -2,9 +2,8 @@ #ifndef _DHCPC_H #define _DHCPC_H -#ifndef DEFAULT_SCRIPT -#define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script" -#endif +/* grab define DEFAULT_SCRIPT */ +#include "libbb_udhcp.h" #define INIT_SELECTING 0 #define REQUESTING 1 diff --git a/networking/udhcp/dumpleases.c b/networking/udhcp/dumpleases.c index ca5c605..c0c58ee 100644 --- a/networking/udhcp/dumpleases.c +++ b/networking/udhcp/dumpleases.c @@ -1,6 +1,6 @@ /* 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 #include diff --git a/networking/udhcp/files.c b/networking/udhcp/files.c index 416b1fe..fe853c7 100644 --- a/networking/udhcp/files.c +++ b/networking/udhcp/files.c @@ -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 */ static int read_opt(const char *const_line, void *arg) { diff --git a/networking/udhcp/libbb_udhcp.h b/networking/udhcp/libbb_udhcp.h index 30e167f..dd58f1b 100644 --- a/networking/udhcp/libbb_udhcp.h +++ b/networking/udhcp/libbb_udhcp.h @@ -3,14 +3,15 @@ /* bit of a hack, do this no matter what the order of the includes. * (for busybox) */ -#ifdef CONFIG_INSTALL_NO_USR -#undef DEFAULT_SCRIPT -#define DEFAULT_SCRIPT "/share/udhcpc/default.script" -#endif - #ifndef _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 #include "busybox.h" @@ -56,12 +57,20 @@ /* from dhcpd.h */ #define server_config udhcp_server_config -#else /* ! BB_VER */ +#else /* ! IN_BUSYBOX */ #include #include #include +#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 FALSE 0 @@ -78,6 +87,6 @@ static inline FILE *xfopen(const char *file, const char *mode) return fp; } -#endif /* BB_VER */ +#endif /* IN_BUSYBOX */ #endif /* _LIBBB_UDHCP_H */ diff --git a/networking/udhcp/options.c b/networking/udhcp/options.c index eebcaaa..d394b4c 100644 --- a/networking/udhcp/options.c +++ b/networking/udhcp/options.c @@ -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); return 0; } - diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c index fe74b82..32fb8a7 100644 --- a/networking/udhcp/packet.c +++ b/networking/udhcp/packet.c @@ -50,7 +50,6 @@ int get_packet(struct dhcpMessage *packet, int fd) "MSFT 98", "" }; - int bytes; int i; char unsigned *vendor; @@ -79,7 +78,6 @@ int get_packet(struct dhcpMessage *packet, int fd) } } - return bytes; } -- cgit v1.1