2157 }
2158 freemsg(nmp);
2159 return (0);
2160
2161 fail:
2162 /* increment dhcpnospoof stat here */
2163 freemsg(nmp);
2164 return (err);
2165 }
2166
2167 /*
2168 * This is called whenever the mac client's mac address changes, to make sure
2169 * we allow use of the new link-local address.
2170 */
2171 static void
2172 mac_protect_update_v6_local_addr(mac_client_impl_t *mcip)
2173 {
2174 uint_t i;
2175 in6_addr_t *token = &mcip->mci_v6_mac_token;
2176 in6_addr_t *v6addr = &mcip->mci_v6_local_addr;
2177 in6_addr_t ll_template = {(uint32_t)V6_LINKLOCAL, 0x0, 0x0, 0x0};
2178
2179 for (i = 0; i < 4; i++) {
2180 v6addr->s6_addr32[i] = token->s6_addr32[i] |
2181 ll_template.s6_addr32[i];
2182 }
2183 mcip->mci_protect_flags |= MPT_FLAG_V6_LOCAL_ADDR_SET;
2184 }
2185
2186 /*
2187 * This is called whenever the mac client's mac address changes, to make sure
2188 * that any existing addresses gained via SLAAC are appropriately updated.
2189 */
2190 static void
2191 mac_protect_update_v6_slaac_addr(mac_client_impl_t *mcip)
2192 {
2193 void *cookie = NULL;
2194 avl_tree_t temp_tree;
2195 avl_tree_t *ttp = &temp_tree, *sip = &mcip->mci_v6_slaac_ip;
2196 in6_addr_t *token = &mcip->mci_v6_mac_token;
2197 slaac_addr_t *addr = NULL;
|
2157 }
2158 freemsg(nmp);
2159 return (0);
2160
2161 fail:
2162 /* increment dhcpnospoof stat here */
2163 freemsg(nmp);
2164 return (err);
2165 }
2166
2167 /*
2168 * This is called whenever the mac client's mac address changes, to make sure
2169 * we allow use of the new link-local address.
2170 */
2171 static void
2172 mac_protect_update_v6_local_addr(mac_client_impl_t *mcip)
2173 {
2174 uint_t i;
2175 in6_addr_t *token = &mcip->mci_v6_mac_token;
2176 in6_addr_t *v6addr = &mcip->mci_v6_local_addr;
2177 in6_addr_t ll_template = {{{ (uint32_t)V6_LINKLOCAL, 0, 0, 0 }}};
2178
2179 for (i = 0; i < 4; i++) {
2180 v6addr->s6_addr32[i] = token->s6_addr32[i] |
2181 ll_template.s6_addr32[i];
2182 }
2183 mcip->mci_protect_flags |= MPT_FLAG_V6_LOCAL_ADDR_SET;
2184 }
2185
2186 /*
2187 * This is called whenever the mac client's mac address changes, to make sure
2188 * that any existing addresses gained via SLAAC are appropriately updated.
2189 */
2190 static void
2191 mac_protect_update_v6_slaac_addr(mac_client_impl_t *mcip)
2192 {
2193 void *cookie = NULL;
2194 avl_tree_t temp_tree;
2195 avl_tree_t *ttp = &temp_tree, *sip = &mcip->mci_v6_slaac_ip;
2196 in6_addr_t *token = &mcip->mci_v6_mac_token;
2197 slaac_addr_t *addr = NULL;
|