Commit 86b5b776 authored by Martina Ferrari's avatar Martina Ferrari

Merge tag 'upstream/1.60+git20151124.452f8e2e' into debian/sid

parents fe9bba96 452f8e2e
...@@ -101,7 +101,7 @@ static int arp_del(char **args) ...@@ -101,7 +101,7 @@ static int arp_del(char **args)
char host[128]; char host[128];
struct arpreq req; struct arpreq req;
struct sockaddr_storage ss; struct sockaddr_storage ss;
struct sockaddr *sa; struct sockaddr *sa = (struct sockaddr *)&ss;
int flags = 0; int flags = 0;
int deleted = 0; int deleted = 0;
...@@ -113,8 +113,7 @@ static int arp_del(char **args) ...@@ -113,8 +113,7 @@ static int arp_del(char **args)
return (-1); return (-1);
} }
safe_strncpy(host, *args, (sizeof host)); safe_strncpy(host, *args, (sizeof host));
sa = (struct sockaddr *)&ss; if (ap->input(0, host, &ss) < 0) {
if (ap->input(0, host, sa) < 0) {
ap->herror(host); ap->herror(host);
return (-1); return (-1);
} }
...@@ -179,7 +178,7 @@ static int arp_del(char **args) ...@@ -179,7 +178,7 @@ static int arp_del(char **args)
usage(); usage();
if (strcmp(*args, "255.255.255.255") != 0) { if (strcmp(*args, "255.255.255.255") != 0) {
safe_strncpy(host, *args, (sizeof host)); safe_strncpy(host, *args, (sizeof host));
if (ap->input(0, host, sa) < 0) { if (ap->input(0, host, &ss) < 0) {
ap->herror(host); ap->herror(host);
return (-1); return (-1);
} }
...@@ -269,7 +268,7 @@ static int arp_set(char **args) ...@@ -269,7 +268,7 @@ static int arp_set(char **args)
char host[128]; char host[128];
struct arpreq req; struct arpreq req;
struct sockaddr_storage ss; struct sockaddr_storage ss;
struct sockaddr *sa; struct sockaddr *sa = (struct sockaddr *)&ss;
int flags; int flags;
memset((char *) &req, 0, sizeof(req)); memset((char *) &req, 0, sizeof(req));
...@@ -280,8 +279,7 @@ static int arp_set(char **args) ...@@ -280,8 +279,7 @@ static int arp_set(char **args)
return (-1); return (-1);
} }
safe_strncpy(host, *args++, (sizeof host)); safe_strncpy(host, *args++, (sizeof host));
sa = (struct sockaddr *)&ss; if (ap->input(0, host, &ss) < 0) {
if (ap->input(0, host, sa) < 0) {
ap->herror(host); ap->herror(host);
return (-1); return (-1);
} }
...@@ -297,10 +295,11 @@ static int arp_set(char **args) ...@@ -297,10 +295,11 @@ static int arp_set(char **args)
if (arp_getdevhw(*args++, &req.arp_ha, hw_set ? hw : NULL) < 0) if (arp_getdevhw(*args++, &req.arp_ha, hw_set ? hw : NULL) < 0)
return (-1); return (-1);
} else { } else {
if (hw->input(*args++, &req.arp_ha) < 0) { if (hw->input(*args++, &ss) < 0) {
fprintf(stderr, _("arp: invalid hardware address\n")); fprintf(stderr, _("arp: invalid hardware address\n"));
return (-1); return (-1);
} }
memcpy(&req.arp_ha, sa, sizeof(*sa));
} }
/* Check out any modifiers. */ /* Check out any modifiers. */
...@@ -356,7 +355,7 @@ static int arp_set(char **args) ...@@ -356,7 +355,7 @@ static int arp_set(char **args)
usage(); usage();
if (strcmp(*args, "255.255.255.255") != 0) { if (strcmp(*args, "255.255.255.255") != 0) {
safe_strncpy(host, *args, (sizeof host)); safe_strncpy(host, *args, (sizeof host));
if (ap->input(0, host, sa) < 0) { if (ap->input(0, host, &ss) < 0) {
ap->herror(host); ap->herror(host);
return (-1); return (-1);
} }
...@@ -530,7 +529,6 @@ static int arp_show(char *name) ...@@ -530,7 +529,6 @@ static int arp_show(char *name)
{ {
char host[100]; char host[100];
struct sockaddr_storage ss; struct sockaddr_storage ss;
struct sockaddr *sa;
char ip[100]; char ip[100];
char hwa[100]; char hwa[100];
char mask[100]; char mask[100];
...@@ -543,15 +541,14 @@ static int arp_show(char *name) ...@@ -543,15 +541,14 @@ static int arp_show(char *name)
host[0] = '\0'; host[0] = '\0';
sa = (struct sockaddr *)&ss;
if (name != NULL) { if (name != NULL) {
/* Resolve the host name. */ /* Resolve the host name. */
safe_strncpy(host, name, (sizeof host)); safe_strncpy(host, name, (sizeof host));
if (ap->input(0, host, sa) < 0) { if (ap->input(0, host, &ss) < 0) {
ap->herror(host); ap->herror(host);
return (-1); return (-1);
} }
safe_strncpy(host, ap->sprint(sa, 1), sizeof(host)); safe_strncpy(host, ap->sprint(&ss, 1), sizeof(host));
} }
/* Open the PROCps kernel table. */ /* Open the PROCps kernel table. */
if ((fp = fopen(_PATH_PROCNET_ARP, "r")) == NULL) { if ((fp = fopen(_PATH_PROCNET_ARP, "r")) == NULL) {
...@@ -587,10 +584,10 @@ static int arp_show(char *name) ...@@ -587,10 +584,10 @@ static int arp_show(char *name)
if (opt_n) if (opt_n)
hostname = "?"; hostname = "?";
else { else {
if (ap->input(0, ip, sa) < 0) if (ap->input(0, ip, &ss) < 0)
hostname = ip; hostname = ip;
else else
hostname = ap->sprint(sa, opt_n | 0x8000); hostname = ap->sprint(&ss, opt_n | 0x8000);
if (strcmp(hostname, ip) == 0) if (strcmp(hostname, ip) == 0)
hostname = "?"; hostname = "?";
} }
......
...@@ -201,11 +201,6 @@ static void showhname(char *hname, int c) ...@@ -201,11 +201,6 @@ static void showhname(char *hname, int c)
case 'f': case 'f':
printf("%s\n", hp->h_name); printf("%s\n", hp->h_name);
break; break;
case 's':
if (p != NULL)
*p = '\0';
printf("%s\n", hp->h_name);
break;
} }
} }
...@@ -392,7 +387,12 @@ int main(int argc, char **argv) ...@@ -392,7 +387,12 @@ int main(int argc, char **argv)
fprintf(stderr, _("gethostname()=`%s'\n"), myname); fprintf(stderr, _("gethostname()=`%s'\n"), myname);
if (!type) if (!type)
printf("%s\n", myname); printf("%s\n", myname);
else else if (type == 's') {
char *p = strchr(myname, '.');
if (p)
*p = '\0';
printf("%s\n", myname);
} else
showhname(myname, type); showhname(myname, type);
break; break;
case 3: case 3:
......
...@@ -255,7 +255,7 @@ int main(int argc, char **argv) ...@@ -255,7 +255,7 @@ int main(int argc, char **argv)
struct sockaddr_storage _sa, _samask; struct sockaddr_storage _sa, _samask;
struct sockaddr *sa = (struct sockaddr *)&_sa; struct sockaddr *sa = (struct sockaddr *)&_sa;
struct sockaddr *samask = (struct sockaddr *)&_samask; struct sockaddr *samask = (struct sockaddr *)&_samask;
struct sockaddr_in *sin = (struct sockaddr_in *)sa; struct sockaddr_in *sin = (struct sockaddr_in *)&_sa;
char host[128]; char host[128];
const struct aftype *ap; const struct aftype *ap;
const struct hwtype *hw; const struct hwtype *hw;
...@@ -265,7 +265,7 @@ int main(int argc, char **argv) ...@@ -265,7 +265,7 @@ int main(int argc, char **argv)
int fd; int fd;
#if HAVE_AFINET6 #if HAVE_AFINET6
extern struct aftype inet6_aftype; extern struct aftype inet6_aftype;
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&_sa;
struct in6_ifreq ifr6; struct in6_ifreq ifr6;
unsigned long prefix_len; unsigned long prefix_len;
char *cp; char *cp;
...@@ -518,7 +518,7 @@ int main(int argc, char **argv) ...@@ -518,7 +518,7 @@ int main(int argc, char **argv)
if (!strcmp(*spp, "broadcast")) { if (!strcmp(*spp, "broadcast")) {
if (*++spp != NULL) { if (*++spp != NULL) {
safe_strncpy(host, *spp, (sizeof host)); safe_strncpy(host, *spp, (sizeof host));
if (ap->input(0, host, sa) < 0) { if (ap->input(0, host, &_sa) < 0) {
if (ap->herror) if (ap->herror)
ap->herror(host); ap->herror(host);
else else
...@@ -542,7 +542,7 @@ int main(int argc, char **argv) ...@@ -542,7 +542,7 @@ int main(int argc, char **argv)
if (*++spp == NULL) if (*++spp == NULL)
usage(); usage();
safe_strncpy(host, *spp, (sizeof host)); safe_strncpy(host, *spp, (sizeof host));
if (ap->input(0, host, sa) < 0) { if (ap->input(0, host, &_sa) < 0) {
if (ap->herror) if (ap->herror)
ap->herror(host); ap->herror(host);
else else
...@@ -564,7 +564,7 @@ int main(int argc, char **argv) ...@@ -564,7 +564,7 @@ int main(int argc, char **argv)
if (*++spp == NULL || didnetmask) if (*++spp == NULL || didnetmask)
usage(); usage();
safe_strncpy(host, *spp, (sizeof host)); safe_strncpy(host, *spp, (sizeof host));
if (ap->input(0, host, sa) < 0) { if (ap->input(0, host, &_sa) < 0) {
if (ap->herror) if (ap->herror)
ap->herror(host); ap->herror(host);
else else
...@@ -654,7 +654,7 @@ int main(int argc, char **argv) ...@@ -654,7 +654,7 @@ int main(int argc, char **argv)
if (*(spp + 1) != NULL) { if (*(spp + 1) != NULL) {
spp++; spp++;
safe_strncpy(host, *spp, (sizeof host)); safe_strncpy(host, *spp, (sizeof host));
if (ap->input(0, host, sa)) { if (ap->input(0, host, &_sa)) {
if (ap->herror) if (ap->herror)
ap->herror(host); ap->herror(host);
else else
...@@ -689,7 +689,7 @@ int main(int argc, char **argv) ...@@ -689,7 +689,7 @@ int main(int argc, char **argv)
if (*++spp == NULL) if (*++spp == NULL)
usage(); usage();
safe_strncpy(host, *spp, (sizeof host)); safe_strncpy(host, *spp, (sizeof host));
if (hw->input(host, sa) < 0) { if (hw->input(host, &_sa) < 0) {
fprintf(stderr, _("%s: invalid %s address.\n"), host, hw->name); fprintf(stderr, _("%s: invalid %s address.\n"), host, hw->name);
goterr = 1; goterr = 1;
spp++; spp++;
...@@ -724,7 +724,7 @@ int main(int argc, char **argv) ...@@ -724,7 +724,7 @@ int main(int argc, char **argv)
prefix_len = 128; prefix_len = 128;
} }
safe_strncpy(host, *spp, (sizeof host)); safe_strncpy(host, *spp, (sizeof host));
if (inet6_aftype.input(1, host, sa) < 0) { if (inet6_aftype.input(1, host, &_sa) < 0) {
if (inet6_aftype.herror) if (inet6_aftype.herror)
inet6_aftype.herror(host); inet6_aftype.herror(host);
else else
...@@ -763,7 +763,7 @@ int main(int argc, char **argv) ...@@ -763,7 +763,7 @@ int main(int argc, char **argv)
{ /* ipv4 address a.b.c.d */ { /* ipv4 address a.b.c.d */
in_addr_t ip, nm, bc; in_addr_t ip, nm, bc;
safe_strncpy(host, *spp, (sizeof host)); safe_strncpy(host, *spp, (sizeof host));
if (inet_aftype.input(0, host, sa) < 0) { if (inet_aftype.input(0, host, &_sa) < 0) {
ap->herror(host); ap->herror(host);
goterr = 1; goterr = 1;
spp++; spp++;
...@@ -815,7 +815,7 @@ int main(int argc, char **argv) ...@@ -815,7 +815,7 @@ int main(int argc, char **argv)
prefix_len = 128; prefix_len = 128;
} }
safe_strncpy(host, *spp, (sizeof host)); safe_strncpy(host, *spp, (sizeof host));
if (inet6_aftype.input(1, host, sa) < 0) { if (inet6_aftype.input(1, host, &_sa) < 0) {
inet6_aftype.herror(host); inet6_aftype.herror(host);
goterr = 1; goterr = 1;
spp++; spp++;
...@@ -856,7 +856,7 @@ int main(int argc, char **argv) ...@@ -856,7 +856,7 @@ int main(int argc, char **argv)
/* ipv4 address a.b.c.d */ /* ipv4 address a.b.c.d */
in_addr_t ip, nm, bc; in_addr_t ip, nm, bc;
safe_strncpy(host, *spp, (sizeof host)); safe_strncpy(host, *spp, (sizeof host));
if (inet_aftype.input(0, host, sa) < 0) { if (inet_aftype.input(0, host, &_sa) < 0) {
ap->herror(host); ap->herror(host);
goterr = 1; goterr = 1;
spp++; spp++;
...@@ -906,7 +906,7 @@ int main(int argc, char **argv) ...@@ -906,7 +906,7 @@ int main(int argc, char **argv)
prefix_len = 128; prefix_len = 128;
} }
safe_strncpy(host, *spp, (sizeof host)); safe_strncpy(host, *spp, (sizeof host));
if (inet6_aftype.input(1, host, sa) < 0) { if (inet6_aftype.input(1, host, &_sa) < 0) {
inet6_aftype.herror(host); inet6_aftype.herror(host);
goterr = 1; goterr = 1;
spp++; spp++;
...@@ -946,7 +946,7 @@ int main(int argc, char **argv) ...@@ -946,7 +946,7 @@ int main(int argc, char **argv)
/* 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 */ broadcast is unexpected */
if (ap->getmask) { if (ap->getmask) {
switch (ap->getmask(host, samask, NULL)) { switch (ap->getmask(host, &_samask, NULL)) {
case -1: case -1:
usage(); usage();
break; break;
...@@ -963,7 +963,7 @@ int main(int argc, char **argv) ...@@ -963,7 +963,7 @@ int main(int argc, char **argv)
fprintf(stderr, _("ifconfig: Cannot set address for this protocol family.\n")); fprintf(stderr, _("ifconfig: Cannot set address for this protocol family.\n"));
exit(1); exit(1);
} }
if (ap->input(0, host, sa) < 0) { if (ap->input(0, host, &_sa) < 0) {
if (ap->herror) if (ap->herror)
ap->herror(host); ap->herror(host);
else else
...@@ -1083,7 +1083,7 @@ static int do_ifcmd(struct interface *x, struct ifcmd *ptr) ...@@ -1083,7 +1083,7 @@ static int do_ifcmd(struct interface *x, struct ifcmd *ptr)
searcher[i] = 1; searcher[i] = 1;
/* copy */ /* copy */
sin = (struct sockaddr_in *)&x->dstaddr; sin = (struct sockaddr_in *)&x->dstaddr_sas;
if (sin->sin_addr.s_addr != ptr->addr) { if (sin->sin_addr.s_addr != ptr->addr) {
return 0; return 0;
} }
...@@ -1113,9 +1113,9 @@ static int get_nmbc_parent(char *parent, ...@@ -1113,9 +1113,9 @@ static int get_nmbc_parent(char *parent,
return -1; return -1;
if (do_if_fetch(i) < 0) if (do_if_fetch(i) < 0)
return 0; return 0;
sin = (struct sockaddr_in *)&i->netmask; sin = (struct sockaddr_in *)&i->netmask_sas;
memcpy(nm, &sin->sin_addr.s_addr, sizeof(*nm)); memcpy(nm, &sin->sin_addr.s_addr, sizeof(*nm));
sin = (struct sockaddr_in *)&i->broadaddr; sin = (struct sockaddr_in *)&i->broadaddr_sas;
memcpy(bc, &sin->sin_addr.s_addr, sizeof(*bc)); memcpy(bc, &sin->sin_addr.s_addr, sizeof(*bc));
return 0; return 0;
} }
......
...@@ -35,16 +35,46 @@ struct interface { ...@@ -35,16 +35,46 @@ struct interface {
int mtu; /* MTU value */ int mtu; /* MTU value */
int tx_queue_len; /* transmit queue length */ int tx_queue_len; /* transmit queue length */
struct ifmap map; /* hardware setup */ struct ifmap map; /* hardware setup */
struct sockaddr addr; /* IP address */ union {
struct sockaddr dstaddr; /* P-P IP address */ struct sockaddr_storage addr_sas;
struct sockaddr broadaddr; /* IP broadcast address */ struct sockaddr addr; /* IP address */
struct sockaddr netmask; /* IP network mask */ };
struct sockaddr ipxaddr_bb; /* IPX network address */ union {
struct sockaddr ipxaddr_sn; /* IPX network address */ struct sockaddr_storage dstaddr_sas;
struct sockaddr ipxaddr_e3; /* IPX network address */ struct sockaddr dstaddr; /* P-P IP address */
struct sockaddr ipxaddr_e2; /* IPX network address */ };
struct sockaddr ddpaddr; /* Appletalk DDP address */ union {
struct sockaddr ecaddr; /* Econet address */ struct sockaddr_storage broadaddr_sas;
struct sockaddr broadaddr; /* IP broadcast address */
};
union {
struct sockaddr_storage netmask_sas;
struct sockaddr netmask; /* IP network mask */
};
union {
struct sockaddr_storage ipxaddr_bb_sas;
struct sockaddr ipxaddr_bb; /* IPX network address */
};
union {
struct sockaddr_storage ipxaddr_sn_sas;
struct sockaddr ipxaddr_sn; /* IPX network address */
};
union {
struct sockaddr_storage ipxaddr_e3_sas;
struct sockaddr ipxaddr_e3; /* IPX network address */
};
union {
struct sockaddr_storage ipxaddr_e2_sas;
struct sockaddr ipxaddr_e2; /* IPX network address */
};
union {
struct sockaddr_storage ddpaddr_sas;
struct sockaddr ddpaddr; /* Appletalk DDP address */
};
union {
struct sockaddr_storage ecaddr_sas;
struct sockaddr ecaddr; /* Econet address */
};
int has_ip; int has_ip;
int has_ipx_bb; int has_ipx_bb;
int has_ipx_sn; int has_ipx_sn;
......
...@@ -50,8 +50,9 @@ static const char *pr_arcnet(const char *ptr) ...@@ -50,8 +50,9 @@ static const char *pr_arcnet(const char *ptr)
#endif #endif
/* Input an ARCnet address and convert to binary. */ /* Input an ARCnet address and convert to binary. */
static int in_arcnet(char *bufp, struct sockaddr *sap) static int in_arcnet(char *bufp, struct sockaddr_storage *sasp)
{ {
struct sockaddr *sap = (struct sockaddr *)sasp;
char *ptr; char *ptr;
char c, *orig; char c, *orig;
int i, val; int i, val;
......
...@@ -58,8 +58,9 @@ pr_ash(const char *ptr) ...@@ -58,8 +58,9 @@ pr_ash(const char *ptr)
struct hwtype ash_hwtype; struct hwtype ash_hwtype;
static int static int
in_ash(char *bufp, struct sockaddr *sap) in_ash(char *bufp, struct sockaddr_storage *sasp)
{ {
struct sockaddr *sap = (struct sockaddr *)sasp;
char *ptr; char *ptr;
unsigned int i = 0; unsigned int i = 0;
...@@ -103,8 +104,9 @@ struct hwtype ash_hwtype = ...@@ -103,8 +104,9 @@ struct hwtype ash_hwtype =
/* Display an Ash socket address. */ /* Display an Ash socket address. */
static const char * static const char *
pr_sash(const struct sockaddr *sap, int numeric) pr_sash(const struct sockaddr_storage *sasp, int numeric)
{ {
const struct sockaddr *sap = (const struct sockaddr *)sasp;
static char buf[64]; static char buf[64];
if (sap->sa_family != AF_ASH) if (sap->sa_family != AF_ASH)
......
...@@ -67,13 +67,14 @@ static const char *AX25_print(const char *ptr) ...@@ -67,13 +67,14 @@ static const char *AX25_print(const char *ptr)
/* Display an AX.25 socket address. */ /* Display an AX.25 socket address. */
static const char * static const char *
AX25_sprint(const struct sockaddr *sap, int numeric) AX25_sprint(const struct sockaddr_storage *sasp, int numeric)
{ {
const struct sockaddr *sap = (const struct sockaddr *)sasp;
static char buf[64]; static char buf[64];
if (sap->sa_family == 0xFFFF || sap->sa_family == 0) if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
return safe_strncpy(buf, _("[NONE SET]"), sizeof(buf)); return safe_strncpy(buf, _("[NONE SET]"), sizeof(buf));
return (AX25_print(((struct sockaddr_ax25 *) sap)->sax25_call.ax25_call)); return (AX25_print(((const struct sockaddr_ax25 *) sasp)->sax25_call.ax25_call));
} }
#ifdef DEBUG #ifdef DEBUG
...@@ -82,14 +83,15 @@ static const char * ...@@ -82,14 +83,15 @@ static const char *
#define _DEBUG 0 #define _DEBUG 0
#endif #endif
static int AX25_input(int type, char *bufp, struct sockaddr *sap) static int AX25_input(int type, char *bufp, struct sockaddr_storage *sasp)
{ {
struct sockaddr *sap = (struct sockaddr *)sasp;
char *ptr; char *ptr;
char *orig, c; char *orig, c;
int i; int i;
sap->sa_family = ax25_aftype.af; sap->sa_family = ax25_aftype.af;
ptr = ((struct sockaddr_ax25 *) sap)->sax25_call.ax25_call; ptr = ((struct sockaddr_ax25 *) sasp)->sax25_call.ax25_call;
/* First, scan and convert the basic callsign. */ /* First, scan and convert the basic callsign. */
orig = bufp; orig = bufp;
...@@ -152,9 +154,10 @@ static void AX25_herror(const char *text) ...@@ -152,9 +154,10 @@ static void AX25_herror(const char *text)
} }
static int AX25_hinput(char *bufp, struct sockaddr *sap) static int AX25_hinput(char *bufp, struct sockaddr_storage *sasp)
{ {
if (AX25_input(0, bufp, sap) < 0) struct sockaddr *sap = (struct sockaddr *)sasp;
if (AX25_input(0, bufp, sasp) < 0)
return (-1); return (-1);
sap->sa_family = ARPHRD_AX25; sap->sa_family = ARPHRD_AX25;
return (0); return (0);
......
...@@ -42,8 +42,9 @@ static const char *ddp_print(const char *ptr) ...@@ -42,8 +42,9 @@ static const char *ddp_print(const char *ptr)
/* Display a ddp domain address. */ /* Display a ddp domain address. */
static const char *ddp_sprint(const struct sockaddr *sap, int numeric) static const char *ddp_sprint(const struct sockaddr_storage *sasp, int numeric)
{ {
const struct sockaddr *sap = (const struct sockaddr *)sasp;
static char buf[64]; static char buf[64];
if (sap->sa_family != AF_APPLETALK) if (sap->sa_family != AF_APPLETALK)
......
...@@ -44,20 +44,20 @@ ec_print(const char *ptr) ...@@ -44,20 +44,20 @@ ec_print(const char *ptr)
/* Display an Econet socket address */ /* Display an Econet socket address */
static const char * static const char *
ec_sprint(const struct sockaddr *sap, int numeric) ec_sprint(const struct sockaddr_storage *sasp, int numeric)
{ {
struct sockaddr_ec *sec = (struct sockaddr_ec *) sap; const struct sockaddr_ec *sec = (const struct sockaddr_ec *)sasp;
if (sap->sa_family != AF_ECONET) if (sasp->ss_family != AF_ECONET)
return _("[NONE SET]"); return _("[NONE SET]");
return ec_print((const char *) &sec->addr); return ec_print((const char *) &sec->addr);
} }
static int static int
ec_input(int type, char *bufp, struct sockaddr *sap) ec_input(int type, char *bufp, struct sockaddr_storage *sasp)
{ {
struct sockaddr_ec *sec = (struct sockaddr_ec *) sap; struct sockaddr_ec *sec = (struct sockaddr_ec *) sasp;
int net, stn; int net, stn;
switch (sscanf(bufp, "%d.%d", &net, &stn)) { switch (sscanf(bufp, "%d.%d", &net, &stn)) {
case 2: case 2:
......
...@@ -53,8 +53,9 @@ static const char *pr_ether(const char *ptr) ...@@ -53,8 +53,9 @@ static const char *pr_ether(const char *ptr)
#endif #endif
/* Input an Ethernet address and convert to binary. */ /* Input an Ethernet address and convert to binary. */
static int in_ether(char *bufp, struct sockaddr *sap) static int in_ether(char *bufp, struct sockaddr_storage *sasp)
{ {
struct sockaddr *sap = (struct sockaddr *)sasp;
char *ptr; char *ptr;
char c, *orig; char c, *orig;
int i; int i;
......
...@@ -67,8 +67,9 @@ static const char *pr_eui64(const char *ptr) ...@@ -67,8 +67,9 @@ static const char *pr_eui64(const char *ptr)
#endif #endif
/* Start the PPP encapsulation on the file descriptor. */ /* Start the PPP encapsulation on the file descriptor. */
static int in_eui64( char *bufp, struct sockaddr *sap ) static int in_eui64(char *bufp, struct sockaddr_storage *sasp)
{ {
struct sockaddr *sap = (struct sockaddr *)sasp;
char *ptr; char *ptr;
char c, *orig; char c, *orig;
int i; int i;
......
...@@ -64,8 +64,9 @@ static const char *pr_fddi(const char *ptr) ...@@ -64,8 +64,9 @@ static const char *pr_fddi(const char *ptr)
#endif #endif
/* Input an FDDI address and convert to binary. */ /* Input an FDDI address and convert to binary. */
static int in_fddi(char *bufp, struct sockaddr *sap) static int in_fddi(char *bufp, struct sockaddr_storage *sasp)
{ {
struct sockaddr *sap = (struct sockaddr *)sasp;
char *ptr; char *ptr;
char c, *orig; char c, *orig;
int i, val; int i, val;
......
...@@ -64,8 +64,9 @@ static const char *pr_hippi(const char *ptr) ...@@ -64,8 +64,9 @@ static const char *pr_hippi(const char *ptr)
#endif #endif
/* Input an HIPPI address and convert to binary. */ /* Input an HIPPI address and convert to binary. */
static int in_hippi(char *bufp, struct sockaddr *sap) static int in_hippi(char *bufp, struct sockaddr_storage *sasp)
{ {
struct sockaddr *sap = (struct sockaddr *)sasp;
char *ptr; char *ptr;
char c, *orig; char c, *orig;
int i, val; int i, val;
......
...@@ -63,8 +63,9 @@ static const char *pr_ib(const char *ptr) ...@@ -63,8 +63,9 @@ static const char *pr_ib(const char *ptr)
#endif #endif
/* Input an Infiniband address and convert to binary. */ /* Input an Infiniband address and convert to binary. */
static int in_ib(char *bufp, struct sockaddr *sap) static int in_ib(char *bufp, struct sockaddr_storage *sasp)
{ {
struct sockaddr *sap = (struct sockaddr *)sasp;
char *ptr; char *ptr;