ndp.c (0a12cda4) ndp.c (69bb4bb4)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 688 unchanged lines hidden (view full) ---

697 uchar_t *opt, struct sockaddr_in6 *from, boolean_t loopback,
698 boolean_t new_prefix)
699{
700 struct nd_opt_prefix_info *po = (struct nd_opt_prefix_info *)opt;
701 char abuf[INET6_ADDRSTRLEN];
702 char pbuf[INET6_ADDRSTRLEN];
703 uint32_t validtime, preftime; /* In seconds */
704 uint32_t recorded_validtime; /* In seconds */
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 688 unchanged lines hidden (view full) ---

697 uchar_t *opt, struct sockaddr_in6 *from, boolean_t loopback,
698 boolean_t new_prefix)
699{
700 struct nd_opt_prefix_info *po = (struct nd_opt_prefix_info *)opt;
701 char abuf[INET6_ADDRSTRLEN];
702 char pbuf[INET6_ADDRSTRLEN];
703 uint32_t validtime, preftime; /* In seconds */
704 uint32_t recorded_validtime; /* In seconds */
705 int plen, dadfails = 0;
705 int plen;
706 struct prefix *other_pr;
707
708 validtime = ntohl(po->nd_opt_pi_valid_time);
709 preftime = ntohl(po->nd_opt_pi_preferred_time);
710 plen = po->nd_opt_pi_prefix_len;
711 if (!new_prefix) {
712 /*
713 * Check 2 hour rule on valid lifetime.

--- 106 unchanged lines hidden (view full) ---

820
821 if (!(pr->pr_state & PR_AUTO)) {
822 int i, tokenlen;
823 in6_addr_t *token;
824 /*
825 * Form a new local address if the lengths match.
826 */
827 if (pr->pr_flags && IFF_TEMPORARY) {
706 struct prefix *other_pr;
707
708 validtime = ntohl(po->nd_opt_pi_valid_time);
709 preftime = ntohl(po->nd_opt_pi_preferred_time);
710 plen = po->nd_opt_pi_prefix_len;
711 if (!new_prefix) {
712 /*
713 * Check 2 hour rule on valid lifetime.

--- 106 unchanged lines hidden (view full) ---

820
821 if (!(pr->pr_state & PR_AUTO)) {
822 int i, tokenlen;
823 in6_addr_t *token;
824 /*
825 * Form a new local address if the lengths match.
826 */
827 if (pr->pr_flags && IFF_TEMPORARY) {
828RETRY_TOKEN:
829 if (IN6_IS_ADDR_UNSPECIFIED(&pi->pi_tmp_token)) {
830 if (!tmptoken_create(pi)) {
831 prefix_delete(pr);
832 return (_B_TRUE);
833 }
834 }
835 tokenlen = TMP_TOKEN_BITS;
836 token = &pi->pi_tmp_token;

--- 43 unchanged lines hidden (view full) ---

880 if (new_prefix) {
881 prefix_delete(pr);
882 return (_B_FALSE);
883 }
884 /* Ignore for addrconf purposes */
885 validtime = preftime = 0;
886 }
887 if ((pr->pr_flags & IFF_TEMPORARY) && new_prefix) {
828 if (IN6_IS_ADDR_UNSPECIFIED(&pi->pi_tmp_token)) {
829 if (!tmptoken_create(pi)) {
830 prefix_delete(pr);
831 return (_B_TRUE);
832 }
833 }
834 tokenlen = TMP_TOKEN_BITS;
835 token = &pi->pi_tmp_token;

--- 43 unchanged lines hidden (view full) ---

879 if (new_prefix) {
880 prefix_delete(pr);
881 return (_B_FALSE);
882 }
883 /* Ignore for addrconf purposes */
884 validtime = preftime = 0;
885 }
886 if ((pr->pr_flags & IFF_TEMPORARY) && new_prefix) {
888 struct sockaddr_in6 sin6;
889 sin6.sin6_family = AF_INET6;
890 sin6.sin6_addr = pr->pr_address;
891 if (do_dad(pi->pi_name, &sin6) != 0) {
892 /* DAD failed, need a new token */
893 dadfails++;
894 logmsg(LOG_WARNING,
895 "incoming_prefix_addrconf_process: "
896 "deprecating temporary token %s\n",
897 inet_ntop(AF_INET6,
898 (void *)&pi->pi_tmp_token, abuf,
899 sizeof (abuf)));
900 tmptoken_delete(pi);
901 if (dadfails == MAX_DAD_FAILURES) {
902 logmsg(LOG_ERR, "Too many DAD "
903 "failures; disabling temporary "
904 "addresses on %s\n", pi->pi_name);
905 pi->pi_TmpAddrsEnabled = 0;
906 prefix_delete(pr);
907 return (_B_TRUE);
908 }
909 goto RETRY_TOKEN;
910 }
911 pr->pr_CreateTime = getcurrenttime() / MILLISEC;
912 if (debug & D_TMP)
913 logmsg(LOG_DEBUG,
914 "created tmp addr(%s v %d p %d)\n",
915 pr->pr_name, validtime, preftime);
916 }
917 }
918

--- 511 unchanged lines hidden ---
887 pr->pr_CreateTime = getcurrenttime() / MILLISEC;
888 if (debug & D_TMP)
889 logmsg(LOG_DEBUG,
890 "created tmp addr(%s v %d p %d)\n",
891 pr->pr_name, validtime, preftime);
892 }
893 }
894

--- 511 unchanged lines hidden ---