diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-03-23 03:05:05 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-03-23 03:05:05 +0000 |
commit | 13c8327b796862847f3682da2902381c39cf24ea (patch) | |
tree | d552ee35bb892efff30a62fc8d5ce924b1bf8703 /networking | |
parent | e1d41b3102a34d92e61b265810306bb437c73ba0 (diff) |
sync busybox and udhcp trees
Diffstat (limited to 'networking')
-rw-r--r-- | networking/udhcp/dhcpc.c | 1 | ||||
-rw-r--r-- | networking/udhcp/dhcpc.h | 5 | ||||
-rw-r--r-- | networking/udhcp/dumpleases.c | 2 | ||||
-rw-r--r-- | networking/udhcp/files.c | 1 | ||||
-rw-r--r-- | networking/udhcp/libbb_udhcp.h | 23 | ||||
-rw-r--r-- | networking/udhcp/options.c | 1 | ||||
-rw-r--r-- | networking/udhcp/packet.c | 2 |
7 files changed, 21 insertions, 14 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index 0c85eca83..fe2225a0c 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 80c3fc2f8..7c93f4232 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 ca5c6059e..c0c58ee35 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 <fcntl.h> #include <string.h> diff --git a/networking/udhcp/files.c b/networking/udhcp/files.c index 416b1feb0..fe853c7cc 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 30e167f64..dd58f1bd6 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 <stdlib.h> #include <stdio.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 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 eebcaaa58..d394b4c39 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 fe74b828f..32fb8a70f 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; } |