don't directly use sockaddr_storage, since we can't always know what

it looks like


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12055 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2003-04-16 16:45:43 +00:00
parent ce9c1eac40
commit 8f06415a58
6 changed files with 52 additions and 49 deletions

View File

@@ -405,11 +405,9 @@ create_and_write_cookie (char *xauthfile,
int fd;
FILE *f;
char hostname[MaxHostNameLen];
struct in_addr loopback;
int saved_errno;
gethostname (hostname, sizeof(hostname));
loopback.s_addr = htonl(INADDR_LOOPBACK);
auth.family = FamilyLocal;
auth.address = hostname;
@@ -455,11 +453,6 @@ create_and_write_cookie (char *xauthfile,
auth.family = FamilyWild;
auth.address_length = 0;
#if 0 /* XXX */
auth.address = (char *)&loopback;
auth.address_length = sizeof(loopback);
#endif
if (XauWriteAuth(f, &auth) == 0) {
saved_errno = errno;
fclose (f);
@@ -754,12 +747,12 @@ replace_cookie(int xserver, int fd, char *filename, int cookiesp) /* XXX */
*/
int
suspicious_address (int sock, struct sockaddr_storage *addr)
suspicious_address (int sock, struct sockaddr *addr)
{
char data[40];
socklen_t len = sizeof(data);
switch (addr->ss_family) {
switch (addr->sa_family) {
case AF_INET:
return ((struct sockaddr_in *)addr)->sin_addr.s_addr !=
htonl(INADDR_LOOPBACK)