Commit Graph

52 Commits

Author SHA1 Message Date
Denis Vlasenko
58875aefe4 assorted fixes uncovered by randomconfig runs 2007-03-22 22:22:10 +00:00
Denis Vlasenko
1787e22465 ifconfig: support (by ignoring it) "inet" before IP address or hostname 2007-03-22 18:56:00 +00:00
Denis Vlasenko
1094452423 ifconfig: use IPv6 infrastructure 2007-02-04 02:40:27 +00:00
Denis Vlasenko
06af216528 suppress warnings about easch <applet>_main() having
no preceding prototype
2007-02-03 17:28:39 +00:00
Denis Vlasenko
270c17c0e6 properly export externs thru *.h files 2006-12-26 17:40:33 +00:00
Denis Vlasenko
bf0a201008 style fixes
last xcalloc replaced by xzalloc
2006-12-26 10:42:51 +00:00
Denis Vlasenko
83e5d6f772 A bunch of defined(__GLIBC__) added. static-linking warning expanded 2006-12-18 21:49:06 +00:00
Denis Vlasenko
d9e15f2068 style cleanup: return(a) -> return a, part 2 2006-11-27 16:49:55 +00:00
Denis Vlasenko
2813ce2aad ifconfig: do not try to continue on errors. not much sence in doing that
IMHO, but requires extra code.
2006-11-27 10:03:21 +00:00
Denis Vlasenko
7ca3921e5e bb_INET_default[] is really just a const "default",
nothing INET-specific
2006-11-21 20:34:21 +00:00
Denis Vlasenko
5096246ffb ifconfig: looks like char host[128] is not really needed. 2006-11-21 20:32:38 +00:00
Denis Vlasenko
04b30ba3b8 ifconfig: preparatory patch, no code changes 2006-11-21 14:26:37 +00:00
Denis Vlasenko
a7189f01a4 add -Wundef, fix uncovered bugs 2006-11-17 20:29:00 +00:00
Denis Vlasenko
1385899416 attempt to regularize atoi mess. 2006-10-08 12:49:22 +00:00
Rob Landley
d921b2ecc0 Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only
had one user), clean up lots of #includes...  General cleanup pass.  What I've
been doing for the last couple days.

And it conflicts!  I've removed httpd.c from this checkin due to somebody else
touching that file.  It builds for me.  I have to catch a bus.  (Now you know
why I'm looking forward to Mercurial.)
2006-08-03 15:41:12 +00:00
Bernhard Reutner-Fischer
dac7ff15b7 - patch from Denis Vlasenko to add and use bb_xsocket() and to use
bb_xopen some more while at it.
  Also use shorter boilerplate while at it.
2006-04-12 17:55:51 +00:00
Rob Landley
c819ca98ee Can't store a pointer in an int on 64 bit platforms. 2005-11-22 17:09:14 +00:00
Bernhard Reutner-Fischer
0b42a6a8cf - remove superfluous C statements ";;" in decompress_unzip.c, dpkg_deb.c ifconfig.c
- gzip.c: see if O_NOFOLLOW is defined before using it, else take alternate path
closes bug #221 (partially; The rest will follow later).
2005-10-07 11:34:50 +00:00
Mike Frysinger
3978abd05b Cristian Ionescu-Idbohrn writes to fix a warning: networking/ifconfig.c uses an uchar ptr to work with a char ptr so change the uchar to char 2005-09-24 23:52:09 +00:00
Rob Landley
ef8f423e90 Erik pointed out that in the last try at the #ifdef cleanup
infrastructure, the compiler isn't smart enough to replace const static 
int with the constant, and allocates space for each set of them, 
bloating the executable something fierce.  Oops.

So now, we #define ENABLE_XXX to 0 or 1 for each CONFIG_XXX (which
is still there so the 1000+ #ifdef/#ifndef tests don't have to be
replaced wholesale).  Changed the test instance in networking/ifconfig.c 
to use this.
2005-07-28 19:36:33 +00:00
Rob Landley
193c8c7383 #ifdef reduction infrastructure, based on an argument between Shaun Jackman,
Rob Landley, and others.

Currently CONFIG options are defined or undefined, so we chop out code with
#ifdefs, ala:
#ifdef CONFIG_THING
  stuff();
#endif

This creates a new header file, bb_config.h, which sets the CONFIG entry to 1
or 0, and lets us do:

  if(CONFIG_THING) stuff();

And let the compiler do dead code elimination to get rid of it.  (Note: #ifdef
will still work because for the 1 case it's a static const int, not a #define.)
2005-07-27 06:55:36 +00:00
Rob Landley
0d38301d85 From: Shaun Jackman <sjackman@gmail.com>
To: busybox@mail.codepoet.org
  
Wrap sockaddr_in6 in a ifdef CONFIG_FEATURE_IPV6.
Include sys/types.h instead of asm/types.h.
Include netinet/if_ether.h instead of linux/if_ether.h
The ioctl request argument is an int, not an unsigned short.
2005-05-03 22:30:08 +00:00
Eric Andersen
c11a6a887b Patch from Thomas Winkler:
ifconfig did not look up hostnames, so
	ifconfig lo localhost
would not work, you have to do
	ifconfig lo 127.0.0.1
2004-03-31 11:30:08 +00:00
Eric Andersen
c7bda1ce65 Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
Eric Andersen
2479445562 Fix/eliminate use of atol 2004-03-06 22:11:45 +00:00
Eric Andersen
b6e58d2b9a Michael Smith writes:
I noticed a problem with ifconfig in busybox 0.60.5. The matching code
seems to exist in busybox CVS as well, so I'll paste in the patch that
fixed it.

I was running:
 # ifconfig wan0 1.2.3.4 pointopoint 1.2.3.5 netmask 255.255.255.255

I was seeing the inet addr and P-t-P addr both being set to 1.2.3.5
(the pointopoint address).

wan0      Link encap:Point-Point Protocol
          inet addr:1.2.3.5  P-t-P:1.2.3.5  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          ...

The patch below seems to fix it.
2003-11-14 03:04:08 +00:00
Eric Andersen
9d9cecfd63 Fix a silly bug I introduced yesterday 2003-06-21 09:05:49 +00:00
Eric Andersen
0cc7e6236a Fix a couple vars that could be used uninitialized 2003-06-20 09:23:34 +00:00
Glenn L McGrath
393183dccc Vodz, last_patch_86 2003-05-26 14:07:50 +00:00
Manuel Novoa III
cad5364599 Major coreutils update. 2003-03-19 09:13:01 +00:00
Eric Andersen
ab4e19afc6 Eliminate most instances where we use linux kernel headers
-Erik
2003-01-14 08:54:08 +00:00
Manuel Novoa III
a6685585d8 Add "Broadcast +" support back in. Also cut the size down some. Not well
tested, but it is the holidays...
2002-12-27 17:42:01 +00:00
Glenn L McGrath
8ae4cab4a8 use #ifdef CONFIG_* instead of #if CONFIG_* 2002-11-26 09:02:06 +00:00
Glenn L McGrath
baf55a85fc Run through indent, fix comments 2002-08-22 18:22:10 +00:00
Eric Andersen
2276d83639 Fixup warnings and undefined operations that show up in gcc-3.1
-Erik
2002-07-11 11:11:56 +00:00
Eric Andersen
51b8bd68bb This patch from Bart Visscher <magick@linux-fan.com> adds
IPV6 support to busybox.  This patch does the following:
    * Add IPv6 support to libbb
    * Enable IPv6 interface address display
    * Add IPv6 config option
    * Adds ping6, an adaptation of the ping applet for IPv6
    * Adds support routines for ping6:
	- xgethostbyname2
	- create_icmp6_socket
    * Adds ifconfig support for IPv6
    * Add support IPv6 to netstat
    * Add IPv6 support to route
Thanks Bart!
2002-07-03 11:46:38 +00:00
Eric Andersen
cd8c436d81 Latest patch from vodz:
-- reverse resolve network name and cache in route and ifconfig
	applets, fix print nslookup server name if compile without
	uClibc, fix route crashe 'route add', fix warnings compile
	networking and pwd_grp applets
2001-11-10 11:22:46 +00:00
Eric Andersen
4acf8f8481 Use error_msg() instead of fprintf(stderr, ...) 2001-10-28 09:36:48 +00:00
Eric Andersen
72f9a4277f Add in some (theoretical) uClinux support. Some init cleanups 2001-10-28 05:12:20 +00:00
Eric Andersen
bdfd0d78bc Major rework of the directory structure and the entire build system.
-Erik
2001-10-24 05:00:29 +00:00
Manuel Novoa III
4fb0b51703 This corrects the _really_poor_ implementation of "broadcast +" handling
by ifconfig that someone had submitted.  It fixes 1 bug, gets rid of the
excessive bloating of a structure that is used in a static const array,
and removes the implicit struct copys by keeping only the int type needed.
It also turns this into a configurable feature (off by default).
2001-08-10 06:02:23 +00:00
Eric Andersen
48dfc56b4a This patch from Fabio Ferrari <fabio.ferrari@digitro.com.br> enables
"broadcast +" for deriving the broadcast address automagically.
2001-07-07 05:19:52 +00:00
Manuel Novoa III
049dc25fe7 Fix in_ether bug regarding hex digits reported by Jonas Holmberg <jonas.holmberg@axis.com>. 2001-03-26 16:26:16 +00:00
Eric Andersen
48dcc16548 Don't confuse people. If the run 'ifconfig' and they didn't
compile with BB_FEATURE_IFCONFIG_STATUS turned on, it will
now print a message telling them as much.
 -Erik
2001-03-15 20:48:45 +00:00
Manuel Novoa III
68ea1d0325 Reduced code size of interface. Support ifconfig -a and ifconfig interface
display.  Change %llu to %Lu in ifconfig for hacked unsigned long long support
in uClibc scanf.
2001-03-12 09:57:59 +00:00
Manuel Novoa III
78f57460f2 Quick mod to enable option -a for ifconfig. 2001-03-10 02:00:54 +00:00
Manuel Novoa III
fa45f22e50 Use perror_msg_and_die function where appropriate. 2001-03-09 23:06:15 +00:00
Manuel Novoa III
df351d6109 Improved port of ifconfig... smaller and with more features. 2001-03-08 22:57:00 +00:00
Eric Andersen
f15d4dad66 Add in a first pass at ifconfig status reporting. It took a long while
hacking on the mess in net-tools-1.59, but it currently adds 12k and
supports ethernet, loop, ppp, and treats everything else as a generic
interface.  Works ok for me.
 -Erik
2001-03-06 00:48:59 +00:00
Eric Andersen
cbe31dace5 It turns out that DODMALLOC was broken when I reorganized busybox.h
header file usage before the 0.49 release.  To fix it, I had to move
the '#include "busybox.h"' to the end of the list of #include files.
 -Erik
2001-02-20 06:14:08 +00:00