summaryrefslogtreecommitdiffstats
path: root/usr.bin/talk
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-03-12 10:23:30 +0000
committerache <ache@FreeBSD.org>1996-03-12 10:23:30 +0000
commitee6c90f5c0b055a4bd0469ed771364276392a872 (patch)
treeb3a9e0accac35f4a1755333f602fcb6809c9d750 /usr.bin/talk
parentba0b5e96d01d0cca5891605bf9dd055e9e4a44f1 (diff)
downloadFreeBSD-src-ee6c90f5c0b055a4bd0469ed771364276392a872.zip
FreeBSD-src-ee6c90f5c0b055a4bd0469ed771364276392a872.tar.gz
Increment network byte order properly
Reviewed by: wollman
Diffstat (limited to 'usr.bin/talk')
-rw-r--r--usr.bin/talk/get_iface.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/talk/get_iface.c b/usr.bin/talk/get_iface.c
index 58defdc..741392e 100644
--- a/usr.bin/talk/get_iface.c
+++ b/usr.bin/talk/get_iface.c
@@ -29,7 +29,7 @@
* From:
* Id: find_interface.c,v 1.1 1995/08/14 16:08:39 wollman Exp
*
- * $Id$
+ * $Id: get_iface.c,v 1.1 1996/03/09 19:22:52 joerg Exp $
*/
#include <unistd.h>
@@ -70,7 +70,7 @@ get_iface(dst, iface)
do {
rv = bind(s, (struct sockaddr *)&local, sizeof local);
- local.sin_port++;
+ local.sin_port = htons(ntohs(local.sin_port) + 1);
} while(rv < 0 && errno == EADDRINUSE);
if (rv < 0) {
@@ -80,7 +80,7 @@ get_iface(dst, iface)
do {
rv = connect(s, (struct sockaddr *)&remote, sizeof remote);
- remote.sin_port++;
+ remote.sin_port = htons(ntohs(remote.sin_port) + 1);
} while(rv < 0 && errno == EADDRINUSE);
if (rv < 0) {
OpenPOWER on IntegriCloud