]> andersk Git - openssh.git/commitdiff
- djm@cvs.openbsd.org 2004/07/21 11:51:29
authordjm <djm>
Wed, 21 Jul 2004 11:53:34 +0000 (11:53 +0000)
committerdjm <djm>
Wed, 21 Jul 2004 11:53:34 +0000 (11:53 +0000)
     [canohost.c]
     bz#902: cache remote port so we don't fatal() in auth_log when remote
     connection goes away quickly. from peak AT argo.troja.mff.cuni.cz;
     ok markus@

ChangeLog
canohost.c

index d2eadea590374cdc63907ffc4ba2fc675c182bd1..0f4c4ac544dc2d6d9f5277e22f1805e3b347ada9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
    - djm@cvs.openbsd.org 2004/07/21 10:36:23
      [gss-serv-krb5.c]
      fix function declaration
+   - djm@cvs.openbsd.org 2004/07/21 11:51:29
+     [canohost.c]
+     bz#902: cache remote port so we don't fatal() in auth_log when remote
+     connection goes away quickly. from peak AT argo.troja.mff.cuni.cz;
+     ok markus@
  - (djm) [auth-pam.c] Portable parts of bz#899: Don't display invalid 
    usernames in setproctitle from peak AT argo.troja.mff.cuni.cz;
 
index 057f061b6aa51b5d31108974fedcfecd63cbfc04..8ad684d6c383d81843101743180d89760100ef13 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: canohost.c,v 1.40 2004/06/21 17:36:31 avsm Exp $");
+RCSID("$OpenBSD: canohost.c,v 1.41 2004/07/21 11:51:29 djm Exp $");
 
 #include "packet.h"
 #include "xmalloc.h"
@@ -382,7 +382,13 @@ get_peer_port(int sock)
 int
 get_remote_port(void)
 {
-       return get_port(0);
+       static int port = -1;
+
+       /* Cache to avoid getpeername() on a dead connection */
+       if (port == -1)
+               port = get_port(0);
+
+       return port;
 }
 
 int
This page took 0.0452 seconds and 5 git commands to generate.