summaryrefslogtreecommitdiffstats
path: root/usr.bin/talk/ctl.c
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1996-03-09 19:23:01 +0000
committerjoerg <joerg@FreeBSD.org>1996-03-09 19:23:01 +0000
commita12cf8aa0e1029b87db1d40e09450d0d09635334 (patch)
tree05d5824bd651018bd12409c9b3fa9369e6f2c193 /usr.bin/talk/ctl.c
parent17cc9fc50275a82f4224ba957d768981a45929d7 (diff)
downloadFreeBSD-src-a12cf8aa0e1029b87db1d40e09450d0d09635334.zip
FreeBSD-src-a12cf8aa0e1029b87db1d40e09450d0d09635334.tar.gz
Make talk automagically find out the interface IP address where the
remote peer will be connected through. This avoids the ``Checking for invitation on caller's machine'' problem for multi-homed hosts. Thanks to: Garrett, for his `find_interface' example
Diffstat (limited to 'usr.bin/talk/ctl.c')
-rw-r--r--usr.bin/talk/ctl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/talk/ctl.c b/usr.bin/talk/ctl.c
index 18b0c5c..2f77608 100644
--- a/usr.bin/talk/ctl.c
+++ b/usr.bin/talk/ctl.c
@@ -64,6 +64,7 @@ int invitation_waiting = 0;
CTL_MSG msg;
+void
open_sockt()
{
int length;
@@ -81,6 +82,7 @@ open_sockt()
}
/* open the ctl socket */
+void
open_ctl()
{
int length;
@@ -100,13 +102,14 @@ open_ctl()
}
/* print_addr is a debug print routine */
+void
print_addr(addr)
struct sockaddr_in addr;
{
int i;
- printf("addr = %x, port = %o, family = %o zero = ",
- addr.sin_addr, addr.sin_port, addr.sin_family);
+ printf("addr = %lx, port = %o, family = %o zero = ",
+ addr.sin_addr.s_addr, addr.sin_port, addr.sin_family);
for (i = 0; i<8;i++)
printf("%o ", (int)addr.sin_zero[i]);
putchar('\n');
OpenPOWER on IntegriCloud