Print this page
Current snapshot of OpenSolaris port.
Checkpoint
Checkpoint
Merge from parent.
Merge with WIDE update.
Pull from WIDE.
Pull from WIDE.
Checkpoint
Re-update.
blah
WIDE update
Update from WIDE.

Split Close
Expand all
Collapse all
          --- old/iked/ikev1/ikev1_natt.c
          +++ new/iked/ikev1/ikev1_natt.c
↓ open down ↓ 38 lines elided ↑ open up ↑
  39   39  #endif
  40   40  #if defined(__NetBSD__) || defined (__FreeBSD__)
  41   41  #include <netinet/udp.h>
  42   42  #endif
  43   43  
  44   44  #include <stdlib.h>
  45   45  #include <stdio.h>
  46   46  #include <string.h>
  47   47  #include <errno.h>
  48   48  
       49 +#ifdef sun      /* XXX KEBE SAYS OpenSolaris extras */
       50 +#define UDP_ENCAP_ESPINUDP_NON_IKE 1
       51 +#define UDP_ENCAP_ESPINUDP 2
       52 +#endif
       53 +
  49   54  #include "racoon.h"
  50   55  
  51   56  #include "var.h"
  52   57  /* #include "misc.h" */
  53   58  /* #include "vmbuf.h" */
  54   59  #include "plog.h"
  55   60  #include "debug.h"
  56   61  
  57   62  /* #include "localconf.h" */
  58   63  #include "remoteconf.h"
↓ open down ↓ 230 lines elided ↑ open up ↑
 289  294  
 290  295          return 0;
 291  296  }
 292  297  
 293  298  void
 294  299  ikev1_natt_float_ports(struct ph1handle *iph1)
 295  300  {
 296  301          if (!(iph1->natt_flags && NAT_DETECTED))
 297  302                  return;
 298  303          if (!iph1->natt_options->float_port) {
      304 +#ifndef sun     /* XXX KEBE SAYS OpenSolaris does keepalives in-kernel. */
 299  305                  /* Drafts 00 / 01, just schedule keepalive */
 300  306                  natt_keepalive_add_ph1(iph1);
      307 +#endif
 301  308                  return;
 302  309          }
 303  310  
 304  311          set_port(iph1->local, iph1->natt_options->float_port);
 305  312          set_port(iph1->remote, iph1->natt_options->float_port);
 306      -        iph1->natt_flags |= NAT_PORTS_CHANGED | NAT_ADD_NON_ESP_MARKER;
 307  313  
      314 +        iph1->natt_flags |= NAT_PORTS_CHANGED;
      315 +
      316 +#ifndef sun
      317 +        /*
      318 +         * XXX KEBE SAYS OpenSolaris does keepalives in-kernel.
      319 +         * Also, we have in-kernel zero-spi addition.
      320 +         */
      321 +        iph1->natt_flags |= NAT_ADD_NON_ESP_MARKER;
      322 +
 308  323          natt_keepalive_add_ph1(iph1);
      324 +#endif
 309  325  }
 310  326  
 311  327  void
 312  328  ikev1_natt_handle_vendorid(struct ph1handle *iph1, int vid_numeric)
 313  329  {
 314  330          if (!iph1->natt_options)
 315  331                  iph1->natt_options =
 316  332                          racoon_calloc(1, sizeof(*iph1->natt_options));
 317  333  
 318  334          if (!iph1->natt_options) {
 319  335                  plog(PLOG_INTERR, PLOGLOC, NULL,
 320  336                       "Allocating memory for natt_options failed!\n");
 321  337                  return;
 322  338          }
 323  339  
 324  340          if (iph1->natt_options->version < vid_numeric)
 325  341                  if (natt_fill_options(iph1->natt_options, vid_numeric) == 0)
 326  342                          iph1->natt_flags |= NAT_ANNOUNCED;
 327  343  }
 328  344  
      345 +#ifndef sun     /* XXX KEBE SAYS OpenSolaris does keepalives in-kernel. */
 329  346  /* NAT keepalive functions */
 330  347  static void
 331  348  natt_keepalive_send(void *param)
 332  349  {
 333  350          struct natt_ka_addrs *ka, *next = NULL;
 334  351          char keepalive_packet[] = { 0xff };
 335  352          int len;
 336  353          int s;
 337  354  
 338  355          for (ka = TAILQ_FIRST(&ka_tree); ka; ka = next) {
↓ open down ↓ 101 lines elided ↑ open up ↑
 440  457                               "KA removing this one...\n");
 441  458  
 442  459                          TAILQ_REMOVE(&ka_tree, ka, chain);
 443  460                          racoon_free(ka);
 444  461                          /* Should we break here? Every pair of addresses should 
 445  462                           * be inserted only once, but who knows :-) Lets traverse 
 446  463                           * the whole list... */
 447  464                  }
 448  465          }
 449  466  }
      467 +#endif
 450  468  
 451  469  #ifdef notyet
 452  470  static struct remoteconf *
 453  471  natt_enabled_in_rmconf_stub(struct remoteconf *rmconf, void *data)
 454  472  {
 455  473          return (ikev1_nat_traversal(rmconf) == NATT_OFF ? NULL : rmconf);
 456  474  }
 457  475  
 458  476  int
 459  477  natt_enabled_in_rmconf()
↓ open down ↓ 71 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX