include only source NATD payloads really needed
This commit is contained in:
@@ -369,17 +369,27 @@ static status_t get_request(private_ike_sa_init_t *this, message_t **result)
|
|||||||
linked_list_t *list;
|
linked_list_t *list;
|
||||||
host_t *host;
|
host_t *host;
|
||||||
|
|
||||||
/* N(NAT_DETECTION_SOURCE_IP)+ */
|
/* N(NAT_DETECTION_SOURCE_IP)+
|
||||||
|
* we include only one notify if our address is defined, but all
|
||||||
|
* possible if not */
|
||||||
|
host = this->connection->get_my_host(this->connection);
|
||||||
|
if (host->is_anyaddr(host))
|
||||||
|
{
|
||||||
|
/* TODO: we could get the src address from netlink */
|
||||||
list = charon->socket->create_local_address_list(charon->socket);
|
list = charon->socket->create_local_address_list(charon->socket);
|
||||||
while (list->remove_first(list, (void**)&host) == SUCCESS)
|
while (list->remove_first(list, (void**)&host) == SUCCESS)
|
||||||
{
|
{
|
||||||
/* TODO: should we only include NAT payloads for addresses
|
|
||||||
* of used address family? */
|
|
||||||
notify = build_natd_payload(this, NAT_DETECTION_SOURCE_IP, host);
|
notify = build_natd_payload(this, NAT_DETECTION_SOURCE_IP, host);
|
||||||
host->destroy(host);
|
host->destroy(host);
|
||||||
request->add_payload(request, (payload_t*)notify);
|
request->add_payload(request, (payload_t*)notify);
|
||||||
}
|
}
|
||||||
list->destroy(list);
|
list->destroy(list);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
notify = build_natd_payload(this, NAT_DETECTION_SOURCE_IP, host);
|
||||||
|
request->add_payload(request, (payload_t*)notify);
|
||||||
|
}
|
||||||
|
|
||||||
/* N(NAT_DETECTION_DESTINATION_IP) */
|
/* N(NAT_DETECTION_DESTINATION_IP) */
|
||||||
notify = build_natd_payload(this, NAT_DETECTION_DESTINATION_IP, other);
|
notify = build_natd_payload(this, NAT_DETECTION_DESTINATION_IP, other);
|
||||||
|
|||||||
Reference in New Issue
Block a user