- deraadt@cvs.openbsd.org 2002/06/23 21:06:41
     [channels.c channels.h session.c session.h]
     display, screen, row, col, xpixel, ypixel are u_int; markus ok
  - (bal) Also fixed IPADDR_IN_DISPLAY case where display, screen, row, col,
    xpixel are u_int.
diff --git a/ChangeLog b/ChangeLog
index 159b0d8..d0026c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,6 +29,12 @@
    - deraadt@cvs.openbsd.org 2002/06/23 21:06:13
      [sshpty.c]
      KNF
+   - deraadt@cvs.openbsd.org 2002/06/23 21:06:41
+     [channels.c channels.h session.c session.h]
+     display, screen, row, col, xpixel, ypixel are u_int; markus ok
+  - (bal) Also fixed IPADDR_IN_DISPLAY case where display, screen, row, col,
+    xpixel are u_int.
+
 
 20020623
  - (stevesk) [configure.ac] bug #255 LOGIN_NEEDS_UTMPX for AIX.
@@ -1073,4 +1079,4 @@
  - (stevesk) entropy.c: typo in debug message
  - (djm) ssh-keygen -i needs seeded RNG; report from markus@
 
-$Id: ChangeLog,v 1.2262 2002/06/23 21:42:50 mouring Exp $
+$Id: ChangeLog,v 1.2263 2002/06/23 21:48:28 mouring Exp $
diff --git a/channels.c b/channels.c
index d34411e..b85ee57 100644
--- a/channels.c
+++ b/channels.c
@@ -39,7 +39,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: channels.c,v 1.175 2002/06/10 22:28:41 markus Exp $");
+RCSID("$OpenBSD: channels.c,v 1.176 2002/06/23 21:06:41 deraadt Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -2328,12 +2328,12 @@
 
 /*
  * Creates an internet domain socket for listening for X11 connections.
- * Returns a suitable display number for the DISPLAY variable, or -1 if
- * an error occurs.
+ * Returns 0 and a suitable display number for the DISPLAY variable
+ * stored in display_numberp , or -1 if an error occurs.
  */
 int
 x11_create_display_inet(int x11_display_offset, int x11_use_localhost,
-    int single_connection)
+    int single_connection, u_int *display_numberp)
 {
 	Channel *nc = NULL;
 	int display_number, sock;
@@ -2431,7 +2431,8 @@
 	}
 
 	/* Return the display number for the DISPLAY environment variable. */
-	return display_number;
+	*display_numberp = display_number;
+	return (0);
 }
 
 static int
diff --git a/channels.h b/channels.h
index 9ceff3e..64f6c41 100644
--- a/channels.h
+++ b/channels.h
@@ -1,4 +1,4 @@
-/*	$OpenBSD: channels.h,v 1.68 2002/06/10 22:28:41 markus Exp $	*/
+/*	$OpenBSD: channels.h,v 1.69 2002/06/23 21:06:41 deraadt Exp $	*/
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -205,7 +205,7 @@
 /* x11 forwarding */
 
 int	 x11_connect_display(void);
-int	 x11_create_display_inet(int, int, int);
+int	 x11_create_display_inet(int, int, int, u_int *);
 void     x11_input_open(int, u_int32_t, void *);
 void	 x11_request_forwarding_with_spoofing(int, const char *, const char *);
 void	 deny_input_open(int, u_int32_t, void *);
diff --git a/session.c b/session.c
index fab66d6..9abe028 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.139 2002/06/23 20:39:45 deraadt Exp $");
+RCSID("$OpenBSD: session.c,v 1.140 2002/06/23 21:06:41 deraadt Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -1970,9 +1970,9 @@
 		debug("X11 display already set.");
 		return 0;
 	}
-	s->display_number = x11_create_display_inet(options.x11_display_offset,
-	    options.x11_use_localhost, s->single_connection);
-	if (s->display_number == -1) {
+	if (x11_create_display_inet(options.x11_display_offset,
+	    options.x11_use_localhost, s->single_connection,
+	    &s->display_number) == -1) {
 		debug("x11_create_display_inet failed.");
 		return 0;
 	}
@@ -1986,9 +1986,9 @@
 	 * different than the DISPLAY string for localhost displays.
 	 */
 	if (options.x11_use_localhost) {
-		snprintf(display, sizeof display, "localhost:%d.%d",
+		snprintf(display, sizeof display, "localhost:%u.%u",
 		    s->display_number, s->screen);
-		snprintf(auth_display, sizeof auth_display, "unix:%d.%d",
+		snprintf(auth_display, sizeof auth_display, "unix:%u.%u",
 		    s->display_number, s->screen);
 		s->display = xstrdup(display);
 		s->auth_display = xstrdup(auth_display);
@@ -2004,10 +2004,10 @@
 			return 0;
 		}
 		memcpy(&my_addr, he->h_addr_list[0], sizeof(struct in_addr));
-		snprintf(display, sizeof display, "%.50s:%d.%d", inet_ntoa(my_addr),
+		snprintf(display, sizeof display, "%.50s:%u.%u", inet_ntoa(my_addr),
 		    s->display_number, s->screen);
 #else
-		snprintf(display, sizeof display, "%.400s:%d.%d", hostname,
+		snprintf(display, sizeof display, "%.400s:%u.%u", hostname,
 		    s->display_number, s->screen);
 #endif
 		s->display = xstrdup(display);
diff --git a/session.h b/session.h
index 2a7e4b2..3bce978 100644
--- a/session.h
+++ b/session.h
@@ -1,4 +1,4 @@
-/*	$OpenBSD: session.h,v 1.17 2002/03/29 18:59:32 markus Exp $	*/
+/*	$OpenBSD: session.h,v 1.18 2002/06/23 21:06:41 deraadt Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001 Markus Friedl.  All rights reserved.
@@ -37,15 +37,15 @@
 	/* tty */
 	char	*term;
 	int	ptyfd, ttyfd, ptymaster;
-	int	row, col, xpixel, ypixel;
+	u_int	row, col, xpixel, ypixel;
 	char	tty[TTYSZ];
 	/* last login */
 	char	hostname[MAXHOSTNAMELEN];
 	time_t	last_login_time;
 	/* X11 */
-	int	display_number;
+	u_int	display_number;
 	char	*display;
-	int	screen;
+	u_int	screen;
 	char	*auth_display;
 	char	*auth_proto;
 	char	*auth_data;