mobike: try to keep existing source address before switching to another

This commit is contained in:
Martin Willi
2008-10-08 08:23:46 +00:00
parent e39b271b17
commit ce5b17082d
7 changed files with 43 additions and 29 deletions
+2 -2
View File
@@ -277,7 +277,7 @@ static void transmit(private_ike_mobike_t *this, packet_t *packet)
other_old = this->ike_sa->get_other_host(this->ike_sa);
me = charon->kernel_interface->get_source_addr(
charon->kernel_interface, other_old);
charon->kernel_interface, other_old, NULL);
if (me)
{
me->set_port(me, me->ip_equals(me, me_old) ?
@@ -289,7 +289,7 @@ static void transmit(private_ike_mobike_t *this, packet_t *packet)
while (iterator->iterate(iterator, (void**)&other))
{
me = charon->kernel_interface->get_source_addr(
charon->kernel_interface, other);
charon->kernel_interface, other, NULL);
if (me)
{
if (me->get_family(me) != other->get_family(other))
+2 -3
View File
@@ -341,9 +341,8 @@ static status_t build_i(private_ike_natd_t *this, message_t *message)
}
else
{
host = charon->kernel_interface->get_source_addr(
charon->kernel_interface,
this->ike_sa->get_other_host(this->ike_sa));
host = charon->kernel_interface->get_source_addr(charon->kernel_interface,
this->ike_sa->get_other_host(this->ike_sa), NULL);
if (host)
{ /* 2. */
host->set_port(host, IKEV2_UDP_PORT);