Commit d1381f90 authored by Mike Frysinger's avatar Mike Frysinger

trim trailing whitespace

Signed-off-by: 's avatarMike Frysinger <vapier@gentoo.org>
parent 35eaa82d
......@@ -27,7 +27,7 @@ of the other options should work as well.
COMPILE
-------
-------
To compile simply use "make".
There should be no warnings or errors.
......
......@@ -18,12 +18,12 @@
# Alan Cox <A.Cox@swansea.ac.uk>
# Copyright 1993-1994 Swansea University Computer Society
#
# Be careful!
# Be careful!
# This Makefile doesn't describe complete dependencies for all include files.
# If you change include files you might need to do make clean.
# If you change include files you might need to do make clean.
#
# set the base of the Installation
# set the base of the Installation
# BASEDIR = /mnt
BASEDIR ?= $(DESTDIR)
......@@ -129,7 +129,7 @@ distcheck: dist
rm -rf net-tools-$(RELEASE)
@printf "\nThe tarball is ready to go:\n%s\n" "`du -b net-tools-$(RELEASE).tar.xz`"
config.h: config.in Makefile
config.h: config.in Makefile
@echo "Configuring the Linux net-tools (NET-3 Base Utilities)..." ; echo
@if [ config.status -nt config.in ]; \
then ./configure.sh config.status; \
......@@ -157,7 +157,7 @@ subdirs: libdir
ifconfig: $(NET_LIB) ifconfig.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ ifconfig.o $(NLIB) $(RESLIB)
nameif: $(NET_LIB) nameif.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ nameif.o $(NLIB) $(RESLIB)
......
......@@ -17,7 +17,7 @@ Please include the output of "program --version" when reporting bugs.
Contents:
README This file.
README.ipv6 Notes for people hacking IPv6.
......
......@@ -34,7 +34,7 @@ make BASEDIR=$RPM_BUILD_ROOT install
strip arp ifconfig rarp route slattach plipconfig ipmaddr iptunnel
cd ../bin
strip hostname netstat
)
)
%clean
rm -rf $RPM_BUILD_ROOT
......@@ -92,7 +92,7 @@ rm -rf $RPM_BUILD_ROOT
* Fri Feb 27 1998 Jason Spangler <jasons@usemail.com>
- changed to net-tools 1.432
- removed old glibc 2.1 patch
* Wed Oct 22 1997 Erik Troan <ewt@redhat.com>
- added extra patches for glibc 2.1
......
......@@ -23,7 +23,7 @@ TODO for net-tools
[ ] supply some informations about new features to HOWTOs
[ ] Config file only works with bash not ash.
[ ] Token ring is almost totally untested.
[ ] additional tools for IPX, AX.25 etc be bundled [ipxripd004, ipx_* tools
[ ] additional tools for IPX, AX.25 etc be bundled [ipxripd004, ipx_* tools
from caldera, axattach] into existing bins
[ ] "SIOCAX25OPTRT" [Joerg (DL1BKE)]. 1.3.75
[ ] dummy NOARP?! (2. default route for preveting hostunreachables on linedrop)
......
......@@ -20,14 +20,14 @@
* Andrew Tridgell : proxy arp netmasks
* Bernd Eckenfels : -n option
* Bernd Eckenfels : Use only /proc for display
* {1.60} Bernd Eckenfels : new arpcode (-i) for 1.3.42 but works
* {1.60} Bernd Eckenfels : new arpcode (-i) for 1.3.42 but works
* with 1.2.x, too
* {1.61} Bernd Eckenfels : more verbose messages
* {1.62} Bernd Eckenfels : check -t for hw adresses and try to
* explain EINVAL (jeff)
*970125 {1.63} Bernd Eckenfels : -a print hardwarename instead of tiltle
*970201 {1.64} Bernd Eckenfels : net-features.h support
*970203 {1.65} Bernd Eckenfels : "#define" in "#if",
*970203 {1.65} Bernd Eckenfels : "#define" in "#if",
* -H|-A additional to -t|-p
*970214 {1.66} Bernd Eckenfels : Fix optarg required for -H and -A
*970412 {1.67} Bernd Eckenfels : device=""; is default
......@@ -35,7 +35,7 @@
*970517 {1.69} Bernd Eckenfels : usage() fixed
*970622 {1.70} Bernd Eckenfels : arp -d priv
*970106 {1.80} Bernd Eckenfels : new syntax without -D and with "dev <If>",
* ATF_MAGIC, ATF_DONTPUB support.
* ATF_MAGIC, ATF_DONTPUB support.
* Typo fix (Debian Bug#5728 Giuliano Procida)
*970803 {1.81} Bernd Eckenfels : removed junk comment line 1
*970925 {1.82} Bernd Eckenfels : include fix for libc6
......@@ -628,7 +628,7 @@ static void usage(void)
fprintf(stderr, _(" arp [-vnD] [<HW>] [-i <if>] -f [<filename>] <-Add entry from file\n"));
fprintf(stderr, _(" arp [-v] [<HW>] [-i <if>] -s <host> <hwaddr> [temp] <-Add entry\n"));
fprintf(stderr, _(" arp [-v] [<HW>] [-i <if>] -Ds <host> <if> [netmask <nm>] pub <-''-\n\n"));
fprintf(stderr, _(" -a display (all) hosts in alternative (BSD) style\n"));
fprintf(stderr, _(" -e display (all) hosts in default (Linux) style\n"));
fprintf(stderr, _(" -s, --set set a new ARP entry\n"));
......
......@@ -46,7 +46,7 @@ bool 'Does your system support GNU gettext?' I18N n
*
*
* Protocol Families.
*
*
bool 'UNIX protocol family' HAVE_AFUNIX y
bool 'INET (TCP/IP) protocol family' HAVE_AFINET y
bool 'INET6 (IPv6) protocol family' HAVE_AFINET6 y
......
......@@ -6,7 +6,7 @@
* Usage: hostname [-d|-f|-s|-a|-i|-y|-n]
* hostname [-h|-V]
* hostname {name|-F file}
* dnsdmoainname
* dnsdmoainname
* nisdomainname {name|-F file}
*
* Version: hostname 1.101 (2003-10-11)
......@@ -16,7 +16,7 @@
* Changes:
* {1.90} Peter Tobias : Added -a and -i options.
* {1.91} Bernd Eckenfels : -v,-V rewritten, long_opts (major rewrite), usage.
*19960120 {1.95} Bernd Eckenfels : -y/nisdomainname - support for get/setdomainname added
*19960120 {1.95} Bernd Eckenfels : -y/nisdomainname - support for get/setdomainname added
*19960218 {1.96} Bernd Eckenfels : netinet/in.h added
*19980629 {1.97} Arnaldo Carvalho de Melo : gettext instead of catgets for i18n
*20000213 {1.99} Arnaldo Carvalho de Melo : fixed some i18n strings
......
......@@ -19,8 +19,8 @@
*
* {1.34} - 19980630 - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
* - gettext instead of catgets for i18n
* 10/1998 - Andi Kleen. Use interface list primitives.
* 20001008 - Bernd Eckenfels, Patch from RH for setting mtu
* 10/1998 - Andi Kleen. Use interface list primitives.
* 20001008 - Bernd Eckenfels, Patch from RH for setting mtu
* (default AF was wrong)
* 20010404 - Arnaldo Carvalho de Melo, use setlocale
*/
......@@ -93,7 +93,7 @@ int opt_v = 0; /* debugging output flag */
int addr_family = 0; /* currently selected AF */
/* for ipv4 add/del modes */
static int get_nmbc_parent(char *parent, unsigned long *nm,
static int get_nmbc_parent(char *parent, unsigned long *nm,
unsigned long *bc);
static int set_ifstate(char *parent, unsigned long ip,
unsigned long nm, unsigned long bc,
......@@ -115,11 +115,11 @@ static int if_print(char *ifname)
if (!ife) {
return -1;
}
res = do_if_fetch(ife);
if (res >= 0)
res = do_if_fetch(ife);
if (res >= 0)
ife_print(ife);
}
return res;
return res;
}
/* Set a certain interface flag. */
......@@ -129,7 +129,7 @@ static int set_flag(char *ifname, short flag)
safe_strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
if (ioctl(skfd, SIOCGIFFLAGS, &ifr) < 0) {
fprintf(stderr, _("%s: ERROR while getting interface flags: %s\n"),
fprintf(stderr, _("%s: ERROR while getting interface flags: %s\n"),
ifname, strerror(errno));
return (-1);
}
......@@ -161,7 +161,7 @@ static int clr_flag(char *ifname, short flag)
safe_strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0) {
fprintf(stderr, _("%s: ERROR while getting interface flags: %s\n"),
fprintf(stderr, _("%s: ERROR while getting interface flags: %s\n"),
ifname, strerror(errno));
return -1;
}
......@@ -193,7 +193,7 @@ static int test_flag(char *ifname, short flags)
safe_strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0) {
fprintf(stderr, _("%s: ERROR while testing interface flags: %s\n"),
fprintf(stderr, _("%s: ERROR while testing interface flags: %s\n"),
ifname, strerror(errno));
return -1;
}
......@@ -277,7 +277,7 @@ int main(int argc, char **argv)
#endif
#if I18N
setlocale (LC_ALL, "");
setlocale(LC_ALL, "");
bindtextdomain("net-tools", "/usr/share/locale");
textdomain("net-tools");
#endif
......@@ -294,7 +294,7 @@ int main(int argc, char **argv)
else if (!strcmp(*argv, "-v"))
opt_v = 1;
else if (!strcmp(*argv, "-V") || !strcmp(*argv, "-version") ||
!strcmp(*argv, "--version"))
version();
......@@ -304,7 +304,7 @@ int main(int argc, char **argv)
usage();
else {
fprintf(stderr, _("ifconfig: option `%s' not recognised.\n"),
fprintf(stderr, _("ifconfig: option `%s' not recognised.\n"),
argv[0]);
fprintf(stderr, _("ifconfig: `--help' gives usage information.\n"));
exit(1);
......@@ -338,9 +338,9 @@ int main(int argc, char **argv)
/* The next argument is either an address family name, or an option. */
if ((ap = get_aftype(*spp)) != NULL)
spp++; /* it was a AF name */
else
else
ap = get_aftype(DFLT_AF);
if (ap) {
addr_family = ap->af;
skfd = ap->fd;
......@@ -385,7 +385,7 @@ int main(int argc, char **argv)
goterr = 1;
} else {
if (ioctl(skfd, SIOCGIFMAP, &ifr) < 0) {
perror("port: SIOCGIFMAP");
perror("port: SIOCGIFMAP");
goterr = 1;
continue;
}
......@@ -600,8 +600,8 @@ int main(int argc, char **argv)
if (*++spp == NULL)
usage();
if (ioctl(skfd, SIOCGIFMAP, &ifr) < 0) {
fprintf(stderr, "mem_start: SIOCGIFMAP: %s\n", strerror(errno));
spp++;
fprintf(stderr, "mem_start: SIOCGIFMAP: %s\n", strerror(errno));
spp++;
goterr = 1;
continue;
}
......@@ -617,8 +617,8 @@ int main(int argc, char **argv)
if (*++spp == NULL)
usage();
if (ioctl(skfd, SIOCGIFMAP, &ifr) < 0) {
fprintf(stderr, "io_addr: SIOCGIFMAP: %s\n", strerror(errno));
spp++;
fprintf(stderr, "io_addr: SIOCGIFMAP: %s\n", strerror(errno));
spp++;
goterr = 1;
continue;
}
......@@ -634,9 +634,9 @@ int main(int argc, char **argv)
if (*++spp == NULL)
usage();
if (ioctl(skfd, SIOCGIFMAP, &ifr) < 0) {
fprintf(stderr, "irq: SIOCGIFMAP: %s\n", strerror(errno));
fprintf(stderr, "irq: SIOCGIFMAP: %s\n", strerror(errno));
goterr = 1;
spp++;
spp++;
continue;
}
ifr.ifr_map.irq = atoi(*spp);
......@@ -730,7 +730,7 @@ int main(int argc, char **argv)
prefix_len = 128;
}
safe_strncpy(host, *spp, (sizeof host));
if (inet6_aftype.input(1, host,
if (inet6_aftype.input(1, host,
(struct sockaddr *) &sa6) < 0) {
if (inet6_aftype.herror)
inet6_aftype.herror(host);
......@@ -745,7 +745,7 @@ int main(int argc, char **argv)
fd = get_socket_for_af(AF_INET6);
if (fd < 0) {
fprintf(stderr,
fprintf(stderr,
_("No support for INET6 on this system.\n"));
goterr = 1;
spp++;
......@@ -779,7 +779,7 @@ int main(int argc, char **argv)
}
fd = get_socket_for_af(AF_INET);
if (fd < 0) {
fprintf(stderr,
fprintf(stderr,
_("No support for INET on this system.\n"));
goterr = 1;
spp++;
......@@ -787,7 +787,7 @@ int main(int argc, char **argv)
}
memcpy(&ip, &sin.sin_addr.s_addr, sizeof(unsigned long));
if (get_nmbc_parent(ifr.ifr_name, &nm, &bc) < 0) {
fprintf(stderr, _("Interface %s not initialized\n"),
ifr.ifr_name);
......@@ -796,7 +796,7 @@ int main(int argc, char **argv)
continue;
}
set_ifstate(ifr.ifr_name, ip, nm, bc, 1);
}
spp++;
continue;
......@@ -823,7 +823,7 @@ int main(int argc, char **argv)
prefix_len = 128;
}
safe_strncpy(host, *spp, (sizeof host));
if (inet6_aftype.input(1, host,
if (inet6_aftype.input(1, host,
(struct sockaddr *) &sa6) < 0) {
inet6_aftype.herror(host);
goterr = 1;
......@@ -832,10 +832,10 @@ int main(int argc, char **argv)
}
memcpy((char *) &ifr6.ifr6_addr, (char *) &sa6.sin6_addr,
sizeof(struct in6_addr));
fd = get_socket_for_af(AF_INET6);
if (fd < 0) {
fprintf(stderr,
fprintf(stderr,
_("No support for INET6 on this system.\n"));
goterr = 1;
spp++;
......@@ -878,11 +878,11 @@ int main(int argc, char **argv)
spp++;
continue;
}
/* Clear "ip" in case sizeof(unsigned long) > sizeof(sin.sin_addr.s_addr) */
ip = 0;
memcpy(&ip, &sin.sin_addr.s_addr, sizeof(sin.sin_addr.s_addr));
if (get_nmbc_parent(ifr.ifr_name, &nm, &bc) < 0) {
fprintf(stderr, _("Interface %s not initialized\n"),
ifr.ifr_name);
......@@ -953,7 +953,7 @@ int main(int argc, char **argv)
/* If the next argument is a valid hostname, assume OK. */
safe_strncpy(host, *spp, (sizeof host));
/* FIXME: sa is too small for INET6 addresses, inet6 should use that too,
/* FIXME: sa is too small for INET6 addresses, inet6 should use that too,
broadcast is unexpected */
if (ap->getmask) {
switch (ap->getmask(host, &samask, NULL)) {
......@@ -1020,14 +1020,14 @@ int main(int argc, char **argv)
* end, since it's deleted already! - Roman
*
* Should really use regex.h here, not sure though how well it'll go
* with the cross-platform support etc.
* with the cross-platform support etc.
*/
{
char *ptr;
short int found_colon = 0;
for (ptr = ifr.ifr_name; *ptr; ptr++ )
if (*ptr == ':') found_colon++;
if (!(found_colon && *(ptr - 1) == '-'))
goterr |= set_flag(ifr.ifr_name, (IFF_UP | IFF_RUNNING));
}
......@@ -1075,7 +1075,7 @@ static int do_ifcmd(struct interface *x, struct ifcmd *ptr)
char *z, *e;
struct sockaddr_in *sin;
int i;
if (do_if_fetch(x) < 0)
return 0;
if (strncmp(x->name, ptr->base, ptr->baselen) != 0)
......@@ -1091,13 +1091,13 @@ static int do_ifcmd(struct interface *x, struct ifcmd *ptr)
if (i < 0 || i > 255)
abort();
searcher[i] = 1;
/* copy */
sin = (struct sockaddr_in *)&x->dstaddr;
if (sin->sin_addr.s_addr != ptr->addr) {
return 0;
}
if (ptr->flag) {
/* turn UP */
if (set_flag(x->name, IFF_UP | IFF_RUNNING) == -1)
......@@ -1107,7 +1107,7 @@ static int do_ifcmd(struct interface *x, struct ifcmd *ptr)
if (clr_flag(x->name, IFF_UP) == -1)
return -1;
}
return 1; /* all done! */
}
......@@ -1117,7 +1117,7 @@ static int get_nmbc_parent(char *parent,
{
struct interface *i;
struct sockaddr_in *sin;
i = lookup_interface(parent);
if (!i)
return -1;
......@@ -1137,19 +1137,19 @@ static int set_ifstate(char *parent, unsigned long ip,
char buf[IFNAMSIZ];
struct ifcmd pt;
int i;
pt.base = parent;
pt.baselen = strlen(parent);
pt.addr = ip;
pt.flag = flag;
memset(searcher, 0, sizeof(searcher));
i = for_all_interfaces((int (*)(struct interface *,void *))do_ifcmd,
i = for_all_interfaces((int (*)(struct interface *,void *))do_ifcmd,
&pt);
if (i == -1)
return -1;
if (i == 1)
return 0;
/* add a new interface */
for (i = 0; i < 256; i++)
if (searcher[i] == 0)
......@@ -1157,7 +1157,7 @@ static int set_ifstate(char *parent, unsigned long ip,
if (i == 256)
return -1; /* FAILURE!!! out of ip addresses */
if (snprintf(buf, IFNAMSIZ, "%s:%d", parent, i) > IFNAMSIZ)
return -1;
if (set_ip_using(buf, SIOCSIFADDR, ip) == -1)
......
......@@ -28,7 +28,7 @@ struct user_net_device_stats {
};
struct interface {
struct interface *next, *prev;
struct interface *next, *prev;
char name[IFNAMSIZ]; /* interface name */
short type; /* if type */
short flags; /* various flags */
......@@ -87,7 +87,7 @@ extern const char *if_port_text[][4];
#endif
#if !defined(ifr_qlen)
/* Actually it is ifru_ivalue, but that is not present in 2.0 kernel headers */
/* Actually it is ifru_ivalue, but that is not present in 2.0 kernel headers */
#define ifr_qlen ifr_ifru.ifru_mtu
#endif
......
......@@ -400,7 +400,7 @@ int main(int argc, char **argv)
basename = argv[0];
else
basename++;
while (argc > 1) {
if (argv[1][0] != '-')
break;
......
......@@ -376,7 +376,7 @@ static int do_add(int cmd, int argc, char **argv)
return do_add_ioctl(cmd, "gre0", &p);
case IPPROTO_IPV6:
return do_add_ioctl(cmd, "sit0", &p);
default:
default:
fprintf(stderr, _("cannot determine tunnel mode (ipip, gre or sit)\n"));
return -1;
}
......@@ -391,13 +391,13 @@ int do_del(int argc, char **argv)
return -1;
switch (p.iph.protocol) {
case IPPROTO_IPIP:
case IPPROTO_IPIP:
return do_del_ioctl(p.name[0] ? p.name : "tunl0", &p);
case IPPROTO_GRE:
case IPPROTO_GRE:
return do_del_ioctl(p.name[0] ? p.name : "gre0", &p);
case IPPROTO_IPV6:
case IPPROTO_IPV6:
return do_del_ioctl(p.name[0] ? p.name : "sit0", &p);
default:
default:
return do_del_ioctl(p.name, &p);
}
return -1;
......@@ -538,7 +538,7 @@ static int do_show(int argc, char **argv)
return -1;
switch (p.iph.protocol) {
case IPPROTO_IPIP:
case IPPROTO_IPIP:
err = do_get_ioctl(p.name[0] ? p.name : "tunl0", &p);
break;
case IPPROTO_GRE:
......@@ -597,7 +597,7 @@ int main(int argc, char **argv)
basename = argv[0];
else
basename++;
while (argc > 1) {
if (argv[1][0] != '-')
break;
......
......@@ -342,7 +342,7 @@ void print_aflist(int type) {
if ((type == 1 && ((*afp)->rprint == NULL)) || ((*afp)->af == 0)) {
afp++; continue;
}
if ((count % 3) == 0) fprintf(stderr,count?"\n ":" ");
if ((count % 3) == 0) fprintf(stderr,count?"\n ":" ");
txt = (*afp)->name; if (!txt) txt = "..";
fprintf(stderr,"%s (%s) ",txt,(*afp)->title);
count++;
......
......@@ -57,7 +57,7 @@ pr_ash(const char *ptr)
struct hwtype ash_hwtype;
static int
static int
in_ash(char *bufp, struct sockaddr *sap)
{
char *ptr;
......
......@@ -2,7 +2,7 @@
* lib/ddp_gr.c Prinbting of DDP (AppleTalk) routing table
* used by the NET-LIB.
*
* NET-LIB
* NET-LIB
*
* Version: $Id: ddp_gr.c,v 1.4 2002/06/02 05:25:15 ecki Exp $
*
......@@ -87,7 +87,7 @@ int DDP_rprint(int options)
}
fclose(fp);
return 0;
}
......
......@@ -54,7 +54,7 @@ ec_sprint(struct sockaddr *sap, int numeric)
return ec_print((const char *) &sec->addr);
}
static int
static int
ec_input(int type, char *bufp, struct sockaddr *sap)
{
struct sockaddr_ec *sec = (struct sockaddr_ec *) sap;
......
......@@ -6,7 +6,7 @@
* Author: Daniel Stodden <stodden@in.tum.de>
* Copyright 2001 Daniel Stodden
*
* blueprinted from ether.c
* blueprinted from ether.c
* Copyright 1993 MicroWalt Corporation
*
* This program is free software; you can redistribute it
......@@ -54,7 +54,7 @@ static const char *pr_eui64(const char *ptr)
static char buff[64];
snprintf(buff, sizeof(buff), "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X",
(ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377), (ptr[3] & 0377),
(ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377), (ptr[3] & 0377),
(ptr[4] & 0377), (ptr[5] & 0377), (ptr[6] & 0377), (ptr[7] & 0377)
);
return (buff);
......@@ -79,7 +79,7 @@ static int in_eui64( char *bufp, struct sockaddr *sap )
i = 0;
orig = bufp;
while ((*bufp != '\0') && (i < EUI64_ALEN)) {
val = 0;
c = *bufp++;
......@@ -120,7 +120,7 @@ static int in_eui64( char *bufp, struct sockaddr *sap )
*ptr++ = (unsigned char) (val & 0377);
i++;
/* We might get a semicolon here - not required. */
if (*bufp == ':') {
if (_DEBUG && i == EUI64_ALEN)
......
......@@ -29,7 +29,7 @@
/* Split the input string into multiple fields. */
int getargs(char *string, char *arguments[])
{
int len = strlen(string);
int len = strlen(string);
char temp[len+1];
char *sp, *ptr;
int i, argc;
......
/*
* lib/hdlclapb.c
* lib/hdlclapb.c
* This file contains the HDLC/LAPB support for the NET-2 base
* distribution.
*
* Version: $Id: hdlclapb.c,v 1.5 2000/03/05 11:26:02 philip Exp $
*
* Original Author:
* Original Author:
* Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
* Copyright 1993 MicroWalt Corporation
*
......
......@@ -101,7 +101,7 @@ static struct hwtype *hwtypes[] =
#if HAVE_HWTR
&tr_hwtype,
#ifdef ARPHRD_IEEE802_TR
&tr_hwtype1,
&tr_hwtype1,
#endif
#endif
#if HAVE_HWAX25
......@@ -221,7 +221,7 @@ void hwinit()
#if HAVE_HWTR
tr_hwtype.title = _("16/4 Mbps Token Ring");
#ifdef ARPHRD_IEEE802_TR
tr_hwtype1.title = _("16/4 Mbps Token Ring (New)") ;
tr_hwtype1.title = _("16/4 Mbps Token Ring (New)") ;
#endif
#endif
#if HAVE_HWEC
......@@ -285,7 +285,7 @@ void print_hwlist(int type) {
if (((type == 1) && ((*hwp)->alen == 0)) || ((*hwp)->type == -1)) {
hwp++; continue;
}
if ((count % 3) == 0) fprintf(stderr,count?"\n ":" ");
if ((count % 3) == 0) fprintf(stderr,count?"\n ":" ");
txt = (*hwp)->name; if (!txt) txt = "..";
fprintf(stderr,"%s (%s) ",txt,(*hwp)->title);
count++;
......
......@@ -14,11 +14,11 @@
*960203 {1.23} Bernd Eckenfels : net-features support
*960217 {1.24} Bernd Eckenfels : get_sname
*960219 {1.25} Bernd Eckenfels : extern int h_errno
*960329 {1.26} Bernd Eckenfels : resolve 255.255.255.255
*960329 {1.26} Bernd Eckenfels : resolve 255.255.255.255
*980101 {1.27} Bernd Eckenfels : resolve raw sockets in /etc/protocols
*990302 {1.28} Phil Blundell : add netmask to INET_rresolve
*991007 Kurt Garloff : rresolve, resolve: may be hosts
* <garloff@suse.de> store type (host?) in cache
* <garloff@suse.de> store type (host?) in cache
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
......@@ -96,9 +96,9 @@ static int INET_resolve(char *name, struct sockaddr_in *sin, int hostfirst)
#ifdef DEBUG
if (hostfirst) fprintf (stderr, "gethostbyname (%s)\n", name);
#endif
if (hostfirst &&
if (hostfirst &&
(hp = gethostbyname(name)) != (struct hostent *) NULL) {
memcpy((char *) &sin->sin_addr, (char *) hp->h_addr_list[0],
memcpy((char *) &sin->sin_addr, (char *) hp->h_addr_list[0],
sizeof(struct in_addr));
return 0;
}
......@@ -127,18 +127,18 @@ static int INET_resolve(char *name, struct sockaddr_in *sin, int hostfirst)
errno = h_errno;
return -1;
}
memcpy((char *) &sin->sin_addr, (char *) hp->h_addr_list[0],
memcpy((char *) &sin->sin_addr, (char *) hp->h_addr_list[0],
sizeof(struct in_addr));
return 0;
}
/* numeric: & 0x8000: default instead of *,
* & 0x4000: host instead of net,
/* numeric: & 0x8000: default instead of *,
* & 0x4000: host instead of net,
* & 0x0fff: don't resolve
*/
static int INET_rresolve(char *name, size_t len, struct sockaddr_in *sin,
static int INET_rresolve(char *name, size_t len, struct sockaddr_in *sin,
int numeric, unsigned int netmask)
{
struct hostent *ent;
......@@ -243,21 +243,21 @@ static const char *INET_sprint(struct sockaddr *sap, int numeric)
if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
return safe_strncpy(buff, _("[NONE SET]"), sizeof(buff));
if (INET_rresolve(buff, sizeof(buff), (struct sockaddr_in *) sap,
if (INET_rresolve(buff, sizeof(buff), (struct sockaddr_in *) sap,
numeric, 0xffffff00) != 0)
return (NULL);
return (buff);
}
char *INET_sprintmask(struct sockaddr *sap, int numeric,
char *INET_sprintmask(struct sockaddr *sap, int numeric,
unsigned int netmask)
{
static char buff[128];
if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
return safe_strncpy(buff, _("[NONE SET]"), sizeof(buff));
if (INET_rresolve(buff, sizeof(buff), (struct sockaddr_in *) sap,
if (INET_rresolve(buff, sizeof(buff), (struct sockaddr_in *) sap,
numeric, netmask) != 0)
return (NULL);
return (buff);
......
......@@ -44,20 +44,20 @@
extern int h_errno; /* some netdb.h versions don't export this */
char * fix_v4_address(char *buf, struct in6_addr *in6)
{
if (IN6_IS_ADDR_V4MAPPED(in6->s6_addr)) {
char *s =strchr(buf, '.');
if (s) {
char * fix_v4_address(char *buf, struct in6_addr *in6)
{
if (IN6_IS_ADDR_V4MAPPED(in6->s6_addr)) {
char *s =strchr(buf, '.');
if (s) {
while (s > buf && *s != ':')