Why try to be intelligent about address families too late
authorJim Bloom <bloom@ucbvax.Berkeley.EDU>
Sat, 26 Oct 1985 05:55:54 +0000 (21:55 -0800)
committerJim Bloom <bloom@ucbvax.Berkeley.EDU>
Sat, 26 Oct 1985 05:55:54 +0000 (21:55 -0800)
SCCS-vsn: usr.sbin/rwhod/rwhod.c 5.6

usr/src/usr.sbin/rwhod/rwhod.c

index dfa029a..e4d7a8f 100644 (file)
@@ -11,7 +11,7 @@ char copyright[] =
 #endif not lint
 
 #ifndef lint
 #endif not lint
 
 #ifndef lint
-static char sccsid[] = "@(#)rwhod.c    5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)rwhod.c    5.6 (Berkeley) %G%";
 #endif not lint
 
 #include <sys/types.h>
 #endif not lint
 
 #include <sys/types.h>
@@ -86,7 +86,6 @@ main()
        struct sockaddr_in from;
        char path[64];
        int addr, on = 1;
        struct sockaddr_in from;
        char path[64];
        int addr, on = 1;
-       struct hostent *hp;
        char *cp;
        extern char *index();
 
        char *cp;
        extern char *index();
 
@@ -146,12 +145,6 @@ main()
                syslog(LOG_ERR, "setsockopt SO_BROADCAST: %m");
                exit(1);
        }
                syslog(LOG_ERR, "setsockopt SO_BROADCAST: %m");
                exit(1);
        }
-       hp = gethostbyname(myname);
-       if (hp == NULL) {
-               syslog(LOG_ERR, "%s: don't know my own name", myname);
-               exit(1);
-       }
-       sin.sin_family = hp->h_addrtype;
        sin.sin_port = sp->s_port;
        if (bind(s, &sin, sizeof (sin)) < 0) {
                syslog(LOG_ERR, "bind: %m");
        sin.sin_port = sp->s_port;
        if (bind(s, &sin, sizeof (sin)) < 0) {
                syslog(LOG_ERR, "bind: %m");