Properly send IKEv1 packets if no ike_cfg is known yet
authorTobias Brunner <tobias@strongswan.org>
Mon, 14 Jan 2013 11:11:24 +0000 (12:11 +0100)
committerTobias Brunner <tobias@strongswan.org>
Mon, 14 Jan 2013 11:14:16 +0000 (12:14 +0100)
This applies for error notifies.

src/libcharon/sa/ikev1/task_manager_v1.c

index 7d6e7ac..8a4761d 100644 (file)
@@ -411,13 +411,16 @@ static bool send_fragment(private_task_manager_t *this, bool request,
 static bool send_packet(private_task_manager_t *this, bool request,
                                                packet_t *packet)
 {
-       fragmentation_t fragmentation;
+       fragmentation_t fragmentation = FRAGMENTATION_NO;
        ike_cfg_t *ike_cfg;
        host_t *src, *dst;
        chunk_t data;
 
        ike_cfg = this->ike_sa->get_ike_cfg(this->ike_sa);
-       fragmentation = ike_cfg->fragmentation(ike_cfg);
+       if (ike_cfg)
+       {
+               fragmentation = ike_cfg->fragmentation(ike_cfg);
+       }
        data = packet->get_data(packet);
        if (data.len > this->frag.size && (fragmentation == FRAGMENTATION_FORCE ||
           (this->ike_sa->supports_extension(this->ike_sa, EXT_IKE_FRAGMENTATION) &&