90 status = i_ipadm_create_linklocal(iph, addr);
91 if (status != IPADM_SUCCESS)
92 return (status);
93
94 /*
95 * Request in.ndpd to start the autoconfiguration.
96 * If autoconfiguration was already started by another means (e.g.
97 * "ifconfig" ), in.ndpd will return EEXIST.
98 */
99 if (addr->ipadm_stateless || addr->ipadm_stateful) {
100 status = i_ipadm_send_ndpd_cmd(addr->ipadm_ifname, addr,
101 IPADM_CREATE_ADDRS);
102 if (status != IPADM_SUCCESS &&
103 status != IPADM_NDPD_NOT_RUNNING) {
104 (void) i_ipadm_delete_addr(iph, addr);
105 return (status);
106 }
107 }
108
109 /* Persist the intfid. */
110 status = i_ipadm_addr_persist(iph, addr, B_FALSE, i_flags);
111 if (status != IPADM_SUCCESS) {
112 (void) i_ipadm_delete_addr(iph, addr);
113 (void) i_ipadm_send_ndpd_cmd(addr->ipadm_ifname, addr,
114 IPADM_DELETE_ADDRS);
115 }
116
117 return (status);
118 }
119
120 ipadm_status_t
121 i_ipadm_delete_ipv6addrs(ipadm_handle_t iph, ipadm_addrobj_t ipaddr)
122 {
123 ipadm_status_t status;
124
125 /*
126 * Send a msg to in.ndpd to remove the autoconfigured addresses,
127 * and delete the link local that was created.
128 */
129 status = i_ipadm_send_ndpd_cmd(ipaddr->ipadm_ifname, ipaddr,
130 IPADM_DELETE_ADDRS);
|
90 status = i_ipadm_create_linklocal(iph, addr);
91 if (status != IPADM_SUCCESS)
92 return (status);
93
94 /*
95 * Request in.ndpd to start the autoconfiguration.
96 * If autoconfiguration was already started by another means (e.g.
97 * "ifconfig" ), in.ndpd will return EEXIST.
98 */
99 if (addr->ipadm_stateless || addr->ipadm_stateful) {
100 status = i_ipadm_send_ndpd_cmd(addr->ipadm_ifname, addr,
101 IPADM_CREATE_ADDRS);
102 if (status != IPADM_SUCCESS &&
103 status != IPADM_NDPD_NOT_RUNNING) {
104 (void) i_ipadm_delete_addr(iph, addr);
105 return (status);
106 }
107 }
108
109 /* Persist the intfid. */
110 status = i_ipadm_addr_persist(iph, addr, B_FALSE, i_flags, NULL);
111 if (status != IPADM_SUCCESS) {
112 (void) i_ipadm_delete_addr(iph, addr);
113 (void) i_ipadm_send_ndpd_cmd(addr->ipadm_ifname, addr,
114 IPADM_DELETE_ADDRS);
115 }
116
117 return (status);
118 }
119
120 ipadm_status_t
121 i_ipadm_delete_ipv6addrs(ipadm_handle_t iph, ipadm_addrobj_t ipaddr)
122 {
123 ipadm_status_t status;
124
125 /*
126 * Send a msg to in.ndpd to remove the autoconfigured addresses,
127 * and delete the link local that was created.
128 */
129 status = i_ipadm_send_ndpd_cmd(ipaddr->ipadm_ifname, ipaddr,
130 IPADM_DELETE_ADDRS);
|