]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
packet: Define a global default maximum size for IKE packets
authorTobias Brunner <tobias@strongswan.org>
Tue, 16 Sep 2014 13:38:38 +0000 (15:38 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 10 Oct 2014 07:32:42 +0000 (09:32 +0200)
src/libcharon/encoding/message.c
src/libcharon/plugins/socket_default/socket_default_socket.c
src/libcharon/plugins/socket_dynamic/socket_dynamic_socket.c
src/libcharon/plugins/socket_win/socket_win_socket.c
src/libstrongswan/networking/packet.h

index 4504c5b485afb83220cc55cf53906a5feb716e62..5e5647dd6ee5e11c1599f8bfdbe0d511184eba78 100644 (file)
  */
 #define MAX_NAT_D_PAYLOADS 10
 
-/**
- * Maximum packet size for fragmented packets (same as in sockets)
- */
-#define MAX_PACKET 10000
-
 /**
  * A payload rule defines the rules for a payload
  * in a specific message rule. It defines if and how
@@ -2956,7 +2951,7 @@ message_t *message_create_defrag(message_t *fragment)
        }
        INIT(this->frag,
                .max_packet = lib->settings->get_int(lib->settings,
-                                                                               "%s.max_packet", MAX_PACKET, lib->ns),
+                                                               "%s.max_packet", PACKET_MAX_DEFAULT, lib->ns),
        );
        return &this->public;
 }
index 081d3efc7ed73665b5b63ee22e14eb0bf2c1e33f..9cc39955bc621be7e0c287855a66e7ca9c6bdda7 100644 (file)
@@ -45,9 +45,6 @@
 #include <daemon.h>
 #include <threading/thread.h>
 
-/* Maximum size of a packet */
-#define MAX_PACKET 10000
-
 /* these are not defined on some platforms */
 #ifndef SOL_IP
 #define SOL_IP IPPROTO_IP
@@ -739,7 +736,7 @@ socket_default_socket_t *socket_default_socket_create()
                .natt = lib->settings->get_int(lib->settings,
                                                        "%s.port_nat_t", CHARON_NATT_PORT, lib->ns),
                .max_packet = lib->settings->get_int(lib->settings,
-                                                       "%s.max_packet", MAX_PACKET, lib->ns),
+                                                       "%s.max_packet", PACKET_MAX_DEFAULT, lib->ns),
                .set_source = lib->settings->get_bool(lib->settings,
                                                        "%s.plugins.socket-default.set_source", TRUE,
                                                        lib->ns),
index 3161a709fa816e964e860e688cc31e2d226ac4e5..b82a69e1be109aac93827e1688bf6fd4ce6c9474 100644 (file)
@@ -42,9 +42,6 @@
 #include <threading/rwlock.h>
 #include <collections/hashtable.h>
 
-/* Maximum size of a packet */
-#define MAX_PACKET 10000
-
 /* these are not defined on some platforms */
 #ifndef SOL_IP
 #define SOL_IP IPPROTO_IP
@@ -668,7 +665,7 @@ socket_dynamic_socket_t *socket_dynamic_socket_create()
                },
                .lock = rwlock_create(RWLOCK_TYPE_DEFAULT),
                .max_packet = lib->settings->get_int(lib->settings,
-                                                                               "%s.max_packet", MAX_PACKET, lib->ns),
+                                                               "%s.max_packet", PACKET_MAX_DEFAULT, lib->ns),
        );
 
        if (pipe(this->notify) != 0)
index 5ebe04aacccf35a1686cdaed5d1ecaf6170a7b07..fbfbedae16257e6e38cd8951b4a57e7465130407 100644 (file)
@@ -25,9 +25,6 @@
 
 #include <mswsock.h>
 
-/* Maximum size of a packet */
-#define MAX_PACKET 10000
-
 /* number of sockets in use */
 #define SOCKET_COUNT 2
 
@@ -458,7 +455,7 @@ socket_win_socket_t *socket_win_socket_create()
                                                        "%s.port_nat_t", CHARON_NATT_PORT, lib->ns),
                },
                .max_packet = lib->settings->get_int(lib->settings,
-                                                       "%s.max_packet", MAX_PACKET, lib->ns),
+                                                       "%s.max_packet", PACKET_MAX_DEFAULT, lib->ns),
        );
 
        for (i = 0; i < SOCKET_COUNT; i++)
index a96a4b84f07ffa7b91c2b0c375b4852a3d5a1199..1492dd0b9f119c174f23b5ac6e8ab4654a7e2178 100644 (file)
@@ -28,6 +28,11 @@ typedef struct packet_t packet_t;
 #include <library.h>
 #include <networking/host.h>
 
+/**
+ * Maximum packet size we handle by default
+ */
+#define PACKET_MAX_DEFAULT 10000
+
 /**
  * Abstraction of an IP/UDP-Packet, contains data, sender and receiver.
  */