diff options
author | des <des@FreeBSD.org> | 2005-02-23 21:26:55 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2005-02-23 21:26:55 +0000 |
commit | 235eb699e1ae3a95f2db6759c1f520cebd12f7b9 (patch) | |
tree | b4eba8e6bbd8901b7cf908d4fe47526a1174704a /libexec | |
parent | 0b408ef0dc0d84919f3fa821cf12419a8abfc769 (diff) | |
download | FreeBSD-src-235eb699e1ae3a95f2db6759c1f520cebd12f7b9.zip FreeBSD-src-235eb699e1ae3a95f2db6759c1f520cebd12f7b9.tar.gz |
If what we have is a struct sockaddr_storage * and what we want is a
struct sockaddr_storage *, there's no point in casting it prematurely
to a struct sockaddr *. This unbreaks WARNS=6 on sparc64.
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/rexecd/rexecd.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libexec/rexecd/rexecd.c b/libexec/rexecd/rexecd.c index 596c86e..a85c67a 100644 --- a/libexec/rexecd/rexecd.c +++ b/libexec/rexecd/rexecd.c @@ -83,7 +83,7 @@ struct sockaddr_storage sa; char default_shell[] = _PATH_BSHELL; -static void doit(struct sockaddr *); +static void doit(struct sockaddr_storage *); static void getstr(char *, int, const char *); static void error(const char *fmt, ...); @@ -125,12 +125,12 @@ main(int argc, char *argv[]) realhostname_sa(remote, sizeof(remote) - 1, (struct sockaddr *)&from, fromlen); - doit((struct sockaddr *)&from); + doit(&from); return(0); } static void -doit(struct sockaddr *fromp) +doit(struct sockaddr_storage *fromp) { char cmdbuf[NCARGS+1], *cp; char user[16], pass[16]; @@ -159,15 +159,15 @@ doit(struct sockaddr *fromp) port = port * 10 + c - '0'; } if (port != 0) { - sd = socket(fromp->sa_family, SOCK_STREAM, 0); + sd = socket(fromp->ss_family, SOCK_STREAM, 0); if (sd < 0) exit(1); bzero(&sa, sizeof(sa)); - sa.ss_family = fromp->sa_family; - sa.ss_len = fromp->sa_len; + sa.ss_family = fromp->ss_family; + sa.ss_len = fromp->ss_len; if (bind(sd, (struct sockaddr *)&sa, sa.ss_len) < 0) exit(1); - switch (fromp->sa_family) { + switch (fromp->ss_family) { case AF_INET: ((struct sockaddr_in *)fromp)->sin_port = htons(port); break; @@ -177,7 +177,7 @@ doit(struct sockaddr *fromp) default: exit(1); } - if (connect(sd, fromp, fromp->sa_len) < 0) + if (connect(sd, (struct sockaddr *)fromp, fromp->ss_len) < 0) exit(1); } getstr(user, sizeof(user), "username"); |