diff options
Diffstat (limited to 'libexec/talkd/talkd.c')
-rw-r--r-- | libexec/talkd/talkd.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libexec/talkd/talkd.c b/libexec/talkd/talkd.c index 669931b..acaa888 100644 --- a/libexec/talkd/talkd.c +++ b/libexec/talkd/talkd.c @@ -29,6 +29,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $Id$ */ #ifndef lint @@ -43,12 +45,13 @@ static char sccsid[] = "@(#)talkd.c 8.1 (Berkeley) 6/4/93"; /* * The top level of the daemon, the format is heavily borrowed - * from rwhod.c. Basically: find out who and where you are; + * from rwhod.c. Basically: find out who and where you are; * disconnect all descriptors and ttys, and then endless * loop on waiting for and processing requests */ #include <sys/types.h> #include <sys/socket.h> +#include <sys/param.h> #include <protocols/talkd.h> #include <signal.h> #include <syslog.h> @@ -68,7 +71,7 @@ int debug = 0; void timeout(); long lastmsgtime; -char hostname[32]; +char hostname[MAXHOSTNAMELEN + 1]; #define TIMEOUT 30 #define MAXIDLE 120 @@ -109,6 +112,7 @@ main(argc, argv) lastmsgtime = time(0); process_request(mp, &response); /* can block here, is this what I want? */ + mp->ctl_addr.sa_family = htons(mp->ctl_addr.sa_family); cc = sendto(sockt, (char *)&response, sizeof (response), 0, (struct sockaddr *)&mp->ctl_addr, sizeof (mp->ctl_addr)); |