diff options
Diffstat (limited to 'eBones/kadmind')
-rw-r--r-- | eBones/kadmind/admin_server.c | 10 | ||||
-rw-r--r-- | eBones/kadmind/kadm_ser_wrap.c | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/eBones/kadmind/admin_server.c b/eBones/kadmind/admin_server.c index 7f04ff2..ce36eb6 100644 --- a/eBones/kadmind/admin_server.c +++ b/eBones/kadmind/admin_server.c @@ -226,6 +226,16 @@ kadm_listen() log("accept: %s",error_message(errno)); continue; } + addrlen = sizeof(server_parm.admin_addr); + if (getsockname(peer_fd, (struct sockaddr *)&server_parm.admin_addr, + &addrlen)) { + log("getsockname: %s",error_message(errno)); + continue; + } +#ifdef DEBUG + printf("Connection recieved on %s\n", + inet_ntoa(server_parm.admin_addr.sin_addr)); +#endif /* DEBUG */ #ifndef DEBUG /* if you want a sep daemon for each server */ if (pid = fork()) { diff --git a/eBones/kadmind/kadm_ser_wrap.c b/eBones/kadmind/kadm_ser_wrap.c index 79196c6..23664d4 100644 --- a/eBones/kadmind/kadm_ser_wrap.c +++ b/eBones/kadmind/kadm_ser_wrap.c @@ -57,8 +57,7 @@ char realm[]; server_parm.admin_addr.sin_family = AF_INET; if ((hp = gethostbyname(hostname)) == NULL) return KADM_NO_HOSTNAME; - bcopy(hp->h_addr, (char *) &server_parm.admin_addr.sin_addr.s_addr, - hp->h_length); + server_parm.admin_addr.sin_addr.s_addr = INADDR_ANY; server_parm.admin_addr.sin_port = sep->s_port; /* setting up the database */ if (kdb_get_master_key((inter==1),server_parm.master_key, |