pathmtu/pathmtu.c: Place `addreq' with the rest of the `raw' strategy.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 17 Jun 2018 17:07:40 +0000 (18:07 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 5 Sep 2019 12:07:22 +0000 (13:07 +0100)
It's not needed for the `linux' strategy.

pathmtu/pathmtu.c

index 3e8cdcb..ad1f672 100644 (file)
@@ -132,23 +132,6 @@ static size_t addrsz(const union addr *a)
   }
 }
 
-/* Compare two addresses.  Maybe compare the port numbers too. */
-#define AEF_PORT 1u
-static int addreq(const union addr *a, const union addr *b, unsigned f)
-{
-  switch (a->sa.sa_family) {
-    case AF_INET:
-      return (a->sin.sin_addr.s_addr == b->sin.sin_addr.s_addr &&
-             (!(f&AEF_PORT) || a->sin.sin_port == b->sin.sin_port));
-    case AF_INET6:
-      return (!memcmp(a->sin6.sin6_addr.s6_addr,
-                     b->sin6.sin6_addr.s6_addr, 16) &&
-             (!(f&AEF_PORT) || a->sin6.sin6_port == b->sin6.sin6_port));
-    default:
-      abort();
-  }
-}
-
 /*----- Main algorithm skeleton -------------------------------------------*/
 
 struct param {
@@ -420,6 +403,23 @@ static int rawicmp6 = -1, rawudp6 = -1, rawerr6 = 0;
 
 #define IPCK_INIT 0xffff
 
+/* Compare two addresses.  Maybe compare the port numbers too. */
+#define AEF_PORT 1u
+static int addreq(const union addr *a, const union addr *b, unsigned f)
+{
+  switch (a->sa.sa_family) {
+    case AF_INET:
+      return (a->sin.sin_addr.s_addr == b->sin.sin_addr.s_addr &&
+             (!(f&AEF_PORT) || a->sin.sin_port == b->sin.sin_port));
+    case AF_INET6:
+      return (!memcmp(a->sin6.sin6_addr.s6_addr,
+                     b->sin6.sin6_addr.s6_addr, 16) &&
+             (!(f&AEF_PORT) || a->sin6.sin6_port == b->sin6.sin6_port));
+    default:
+      abort();
+  }
+}
+
 /* Compute an IP checksum over some data.  This is a restartable interface:
  * initialize A to `IPCK_INIT' for the first call.
  */