case ISAKMP_NPTYPE_NATD_DRAFT:
case ISAKMP_NPTYPE_NATD_BADDRAFT:
#ifdef IKE_NAT_T
- {
- natd_match_t match;
- if (pa->type != iph1->natd_payload_type) {
- plog(LLV_ERROR, LOCATION, iph1->remote,
- "ignore the packet, "
- "received unexpected natd payload type %d.\n",
- pa->type);
- goto end;
- }
- match = natd_matches(iph1, pa->ptr);
+ if (pa->type == iph1->natd_payload_type) {
+ natd_match_t match = natd_matches(iph1, pa->ptr);
iph1->natt_flags |= natt_natd_received;
if ((match & natd_match_local) != 0)
iph1->natt_flags |= natt_no_local_nat;
case ISAKMP_NPTYPE_NATD_DRAFT:
case ISAKMP_NPTYPE_NATD_BADDRAFT:
#ifdef IKE_NAT_T
- {
- natd_match_t match;
-
- if (pa->type != iph1->natd_payload_type) {
- plog(LLV_ERROR, LOCATION, iph1->remote,
- "ignore the packet, "
- "received unexpected natd payload type %d.\n",
- pa->type);
- goto end;
- }
- match = natd_matches(iph1, pa->ptr);
+ if (pa->type == iph1->natd_payload_type) {
+ natd_match_t match = natd_matches(iph1, pa->ptr);
iph1->natt_flags |= natt_natd_received;
if ((match & natd_match_local) != 0)
iph1->natt_flags |= natt_no_local_nat;
#ifdef IKE_NAT_T
if (natd_type) {
- if (iph1->local_natd)
- p = set_isakmp_payload(p, iph1->local_natd, natd_type);
- if (iph1->remote_natd)
- p = set_isakmp_payload(p, iph1->remote_natd, ISAKMP_NPTYPE_NONE);
+ if ((iph1->natt_flags & NATT_TYPE_MASK) == natt_type_apple) {
+ if (iph1->local_natd)
+ p = set_isakmp_payload(p, iph1->local_natd, natd_type);
+ if (iph1->remote_natd)
+ p = set_isakmp_payload(p, iph1->remote_natd, ISAKMP_NPTYPE_NONE);
+ } else {
+ if (iph1->remote_natd)
+ p = set_isakmp_payload(p, iph1->remote_natd, natd_type);
+ if (iph1->local_natd)
+ p = set_isakmp_payload(p, iph1->local_natd, ISAKMP_NPTYPE_NONE);
+ }
}
#endif
error = 0;