- djm@cvs.openbsd.org 2008/07/13 22:13:07

[channels.c]
     use struct sockaddr_storage instead of struct sockaddr for accept(2)
     address argument. from visibilis AT yahoo.com in bz#1485; ok markus@
This commit is contained in:
Damien Miller 2008-07-14 11:28:58 +10:00
parent 81dec0589a
commit 163886ff71
2 changed files with 12 additions and 8 deletions

View File

@ -6,6 +6,10 @@
-v is also specified, making it consistent with the manual and other -v is also specified, making it consistent with the manual and other
uses of -l. uses of -l.
ok grunk@ ok grunk@
- djm@cvs.openbsd.org 2008/07/13 22:13:07
[channels.c]
use struct sockaddr_storage instead of struct sockaddr for accept(2)
address argument. from visibilis AT yahoo.com in bz#1485; ok markus@
20080712 20080712
- (djm) OpenBSD CVS Sync - (djm) OpenBSD CVS Sync
@ -4642,4 +4646,4 @@
OpenServer 6 and add osr5bigcrypt support so when someone migrates OpenServer 6 and add osr5bigcrypt support so when someone migrates
passwords between UnixWare and OpenServer they will still work. OK dtucker@ passwords between UnixWare and OpenServer they will still work. OK dtucker@
$Id: ChangeLog,v 1.5076 2008/07/14 01:28:29 djm Exp $ $Id: ChangeLog,v 1.5077 2008/07/14 01:28:58 djm Exp $

View File

@ -1,4 +1,4 @@
/* $OpenBSD: channels.c,v 1.284 2008/07/12 04:52:50 djm Exp $ */ /* $OpenBSD: channels.c,v 1.285 2008/07/13 22:13:07 djm Exp $ */
/* /*
* Author: Tatu Ylonen <ylo@cs.hut.fi> * Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@ -1210,7 +1210,7 @@ static void
channel_post_x11_listener(Channel *c, fd_set *readset, fd_set *writeset) channel_post_x11_listener(Channel *c, fd_set *readset, fd_set *writeset)
{ {
Channel *nc; Channel *nc;
struct sockaddr addr; struct sockaddr_storage addr;
int newsock; int newsock;
socklen_t addrlen; socklen_t addrlen;
char buf[16384], *remote_ipaddr; char buf[16384], *remote_ipaddr;
@ -1219,7 +1219,7 @@ channel_post_x11_listener(Channel *c, fd_set *readset, fd_set *writeset)
if (FD_ISSET(c->sock, readset)) { if (FD_ISSET(c->sock, readset)) {
debug("X11 connection requested."); debug("X11 connection requested.");
addrlen = sizeof(addr); addrlen = sizeof(addr);
newsock = accept(c->sock, &addr, &addrlen); newsock = accept(c->sock, (struct sockaddr *)&addr, &addrlen);
if (c->single_connection) { if (c->single_connection) {
debug2("single_connection: closing X11 listener."); debug2("single_connection: closing X11 listener.");
channel_close_fd(&c->sock); channel_close_fd(&c->sock);
@ -1336,7 +1336,7 @@ static void
channel_post_port_listener(Channel *c, fd_set *readset, fd_set *writeset) channel_post_port_listener(Channel *c, fd_set *readset, fd_set *writeset)
{ {
Channel *nc; Channel *nc;
struct sockaddr addr; struct sockaddr_storage addr;
int newsock, nextstate; int newsock, nextstate;
socklen_t addrlen; socklen_t addrlen;
char *rtype; char *rtype;
@ -1360,7 +1360,7 @@ channel_post_port_listener(Channel *c, fd_set *readset, fd_set *writeset)
} }
addrlen = sizeof(addr); addrlen = sizeof(addr);
newsock = accept(c->sock, &addr, &addrlen); newsock = accept(c->sock, (struct sockaddr *)&addr, &addrlen);
if (newsock < 0) { if (newsock < 0) {
error("accept: %.100s", strerror(errno)); error("accept: %.100s", strerror(errno));
return; return;
@ -1395,12 +1395,12 @@ channel_post_auth_listener(Channel *c, fd_set *readset, fd_set *writeset)
{ {
Channel *nc; Channel *nc;
int newsock; int newsock;
struct sockaddr addr; struct sockaddr_storage addr;
socklen_t addrlen; socklen_t addrlen;
if (FD_ISSET(c->sock, readset)) { if (FD_ISSET(c->sock, readset)) {
addrlen = sizeof(addr); addrlen = sizeof(addr);
newsock = accept(c->sock, &addr, &addrlen); newsock = accept(c->sock, (struct sockaddr *)&addr, &addrlen);
if (newsock < 0) { if (newsock < 0) {
error("accept from auth socket: %.100s", strerror(errno)); error("accept from auth socket: %.100s", strerror(errno));
return; return;