Print this page
Commit IPMP changes

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_main.c
          +++ new/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_main.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
  24   25   */
  25   26  
  26   27  /*
  27   28   * The ipmgmtd daemon is started by ip-interface-management SMF service. This
  28   29   * daemon is used to manage, mapping of 'address object' to 'interface name' and
  29   30   * 'logical interface number', on which the address is created. It also provides
  30   31   * a means to update the ipadm persistent data-store.
  31   32   *
  32   33   * The daemon tracks the <addrobj, lifname> mapping in-memory using a linked
  33   34   * list `aobjmap'. Access to this list is synchronized using a readers-writers
↓ open down ↓ 479 lines elided ↑ open up ↑
 513  514  
 514  515          for (;;)
 515  516                  (void) pause();
 516  517  
 517  518  child_out:
 518  519          /* return from main() forcibly exits an MT process */
 519  520          ipmgmt_inform_parent_exit(EXIT_FAILURE);
 520  521          return (EXIT_FAILURE);
 521  522  }
 522  523  
 523      -/*
 524      - * Return TRUE if `ifname' has persistent configuration for the `af' address
 525      - * family in the datastore
 526      - */
 527      -static boolean_t
 528      -ipmgmt_persist_if_exists(char *ifname, sa_family_t af)
 529      -{
 530      -        ipmgmt_getif_cbarg_t cbarg;
 531      -        boolean_t exists = B_FALSE;
 532      -        ipadm_if_info_t *ifp;
 533      -
 534      -        bzero(&cbarg, sizeof (cbarg));
 535      -        cbarg.cb_ifname = ifname;
 536      -        (void) ipmgmt_db_walk(ipmgmt_db_getif, &cbarg, IPADM_DB_READ);
 537      -        if ((ifp = cbarg.cb_ifinfo) != NULL) {
 538      -                if ((af == AF_INET && (ifp->ifi_pflags & IFIF_IPV4)) ||
 539      -                    (af == AF_INET6 && (ifp->ifi_pflags & IFIF_IPV6))) {
 540      -                        exists = B_TRUE;
 541      -                }
 542      -        }
 543      -        free(ifp);
 544      -        return (exists);
 545      -}
 546      -
 547  524  /*
 548  525   * Persist any NGZ interfaces assigned to us from the global zone if they do
 549  526   * not already exist in the persistent db. We need to
 550  527   * do this before any calls to ipadm_enable_if() can succeed (i.e.,
 551  528   * before opening up for door_calls), and after setuid to 'netadm' so that
 552  529   * the persistent db is created with the right permissions.
 553  530   */
 554  531  static void
 555  532  ipmgmt_ngz_persist_if()
 556  533  {
↓ open down ↓ 23 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX