Print this page
More stats to SIOCIPFCFWCFG and add SIOCIPFCFWNEWSZ to affect ring-buffer size.

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/ipf/solaris.c
          +++ new/usr/src/uts/common/inet/ipf/solaris.c
↓ open down ↓ 733 lines elided ↑ open up ↑
 734  734                          if (s == NULL)
 735  735                                  continue;
 736  736                          s++;
 737  737                          if (ddi_create_minor_node(dip, s, S_IFCHR, i,
 738  738                              DDI_PSEUDO, 0) == DDI_FAILURE)
 739  739                                  goto attach_failed;
 740  740                  }
 741  741  
 742  742                  ipf_dev_info = dip;
 743  743  
      744 +                if (ipf_cfw_ring_resize(IPF_CFW_RING_ALLOCATE) != 0)
      745 +                        goto attach_failed;
      746 +
 744  747                  ipfncb = net_instance_alloc(NETINFO_VERSION);
 745  748                  if (ipfncb == NULL)
 746  749                          goto attach_failed;
 747  750  
 748  751                  ipfncb->nin_name = "ipf";
 749  752                  ipfncb->nin_create = ipf_stack_create;
 750  753                  ipfncb->nin_destroy = ipf_stack_destroy;
 751  754                  ipfncb->nin_shutdown = ipf_stack_shutdown;
 752  755                  if (net_instance_register(ipfncb) == DDI_FAILURE) {
 753  756                          net_instance_free(ipfncb);
↓ open down ↓ 7 lines elided ↑ open up ↑
 761  764                  cmn_err(CE_CONT, "IP Filter:stack_create callback_reg=%d", i);
 762  765  #endif
 763  766  
 764  767                  return (DDI_SUCCESS);
 765  768                  /* NOTREACHED */
 766  769          default:
 767  770                  break;
 768  771          }
 769  772  
 770  773  attach_failed:
      774 +        (void) ipf_cfw_ring_resize(IPF_CFW_RING_DESTROY);
 771  775          ddi_remove_minor_node(dip, NULL);
 772  776          ddi_prop_remove_all(dip);
 773  777          ddi_soft_state_fini(&ipf_state);
 774  778          return (DDI_FAILURE);
 775  779  }
 776  780  
 777  781  
 778  782  static int ipf_detach(dip, cmd)
 779  783  dev_info_t *dip;
 780  784  ddi_detach_cmd_t cmd;
↓ open down ↓ 7 lines elided ↑ open up ↑
 788  792          case DDI_DETACH:
 789  793                  if (ipf_detach_check_all() != 0)
 790  794                          return (DDI_FAILURE);
 791  795  
 792  796                  /*
 793  797                   * Undo what we did in ipf_attach, freeing resources
 794  798                   * and removing things we installed.  The system
 795  799                   * framework guarantees we are not active with this devinfo
 796  800                   * node in any other entry points at this time.
 797  801                   */
      802 +                (void) ipf_cfw_ring_resize(IPF_CFW_RING_DESTROY);
 798  803                  ddi_prop_remove_all(dip);
 799  804                  i = ddi_get_instance(dip);
 800  805                  ddi_remove_minor_node(dip, NULL);
 801  806                  if (i > 0) {
 802  807                          cmn_err(CE_CONT, "IP Filter: still attached (%d)\n", i);
 803  808                          return (DDI_FAILURE);
 804  809                  }
 805  810  
 806  811                  vmem_destroy(ipf_minor);
 807  812                  ddi_soft_state_fini(&ipf_state);
↓ open down ↓ 108 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX