chiark / gitweb /
Update automatically managed build utilities.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 15 Apr 2016 18:53:37 +0000 (19:53 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 15 Apr 2016 18:53:37 +0000 (19:53 +0100)
README
debian/changelog
noip.c

diff --git a/README b/README
index 980f5a4b2aa80b12aead7bc02393ac6c4f1f5a0e..b0678454f7c263a7f3b3efb14ccbe98a78514448 100644 (file)
--- a/README
+++ b/README
@@ -261,6 +261,25 @@ noip
        stuff that Emacs does magically find the SSH tunnel and work
        without me having to care.
 
+  Testing
+
+       noip provides a handy way for testing network servers and so on
+       safely.  For a start, you can run your test server apparently on
+       the same port as the real one.  Because noip consults the
+       environment variable NOIP_SOCKETDIR to find out where to put its
+       sockets, you can run two at a time and they don't interfere.
+       And noip doesn't care what port numbers your program tries to
+       bind, so you don't need to jump through stupid hoops in order to
+       test programs which use `privileged' ports.
+
+  Other applications
+
+       There are certainly loads of handy things you can do with noip.
+       If you think of one, let me know!
+
+                                                               Mark Wooding
+                                                       mdw@distorted.org.uk
+
 \f
 Local variables:
 mode: text
index e5c64312c7f16dfc18212a4f9254a3c4f6af25dd..dc8b9a8c41ebf098bcf6c2eb9f3606486800309f 100644 (file)
@@ -1,3 +1,9 @@
+preload-hacks (1.0.5) experimental; urgency=low
+
+  * Fix `errno' clobbering in connect(2).
+
+ -- Mark Wooding <mdw@distorted.org.uk>  Sat, 26 Dec 2009 12:16:38 +0000
+
 preload-hacks (1.0.4) experimental; urgency=low
 
   * Fix overenthusiastic address decoding in accept(2) and friends.
diff --git a/noip.c b/noip.c
index 04abe9339e4a3895b7a775442b2176b3374bf94d..237bfd03cc4fccd855b3d99de54dd3c0752bbeb8 100644 (file)
--- a/noip.c
+++ b/noip.c
@@ -882,17 +882,22 @@ int connect(int sk, const struct sockaddr *sa, socklen_t len)
   int fixup_p = 0;
   int rc;
 
-  if (sa->sa_family == AF_INET) {
-    PRESERVING_ERRNO({
-      do_implicit_bind(sk, &sa, &len, &sun);
-      fixup_p = 1;
-    });
-  }
-  rc = real_connect(sk, sa, len);
-  if (rc < 0) {
-    switch (errno) {
-      case ENOENT:     errno = ECONNREFUSED;   break;
-    }
+  switch (sa->sa_family) {
+    case AF_INET:
+      PRESERVING_ERRNO({
+       do_implicit_bind(sk, &sa, &len, &sun);
+       fixup_p = 1;
+      });
+      rc = real_connect(sk, sa, len);
+      if (rc < 0) {
+       switch (errno) {
+         case ENOENT:  errno = ECONNREFUSED;   break;
+       }
+      }
+      break;
+    default:
+      rc = real_connect(sk, sa, len);
+      break;
   }
   return rc;
 }