Revision 48e5f32d proto/ospf/rt.c

View differences:

proto/ospf/rt.c
1079 1079
{
1080 1080
  struct proto *p = &po->proto;
1081 1081

  
1082
  struct ospf_iface *iface;
1083
  WALK_LIST(iface, po->iface_list)
1082
  struct ospf_iface *ifa;
1083
  WALK_LIST(ifa, po->iface_list)
1084 1084
  {
1085
    if (iface->type == OSPF_IT_VLINK)
1085
    if (ifa->type == OSPF_IT_VLINK)
1086 1086
    {
1087 1087
      struct top_hash_entry *tmp;
1088
      tmp = ospf_hash_find_rt(po->gr, iface->voa->areaid, iface->vid);
1088
      tmp = ospf_hash_find_rt(po->gr, ifa->voa->areaid, ifa->vid);
1089 1089

  
1090 1090
      if (tmp && (tmp->color == INSPF) && ipa_nonzero(tmp->lb) && tmp->nhs)
1091 1091
      {
1092 1092
	struct ospf_iface *nhi = ospf_iface_find(po, tmp->nhs->iface);
1093 1093

  
1094
        if ((iface->state != OSPF_IS_PTP)
1095
	    || (iface->vifa != nhi)
1096
	    || !ipa_equal(iface->vip, tmp->lb))
1094
        if ((ifa->state != OSPF_IS_PTP)
1095
	    || (ifa->vifa != nhi)
1096
	    || !ipa_equal(ifa->vip, tmp->lb))
1097 1097
        {
1098 1098
          OSPF_TRACE(D_EVENTS, "Vlink peer %R found", tmp->lsa.id);
1099
          ospf_iface_sm(iface, ISM_DOWN);
1100
	  iface->vifa = nhi;
1101
          iface->iface = nhi->iface;
1102
	  iface->addr = nhi->addr;
1103
	  iface->sk = nhi->sk;
1104
	  iface->cost = tmp->dist;
1105
          iface->vip = tmp->lb;
1106
          ospf_iface_sm(iface, ISM_UP);
1099
          ospf_iface_sm(ifa, ISM_DOWN);
1100
	  ifa->vifa = nhi;
1101
	  ifa->addr = nhi->addr;
1102
	  ifa->cost = tmp->dist;
1103
          ifa->vip = tmp->lb;
1104
          ospf_iface_sm(ifa, ISM_UP);
1107 1105
        }
1108
	else if ((iface->state == OSPF_IS_PTP) && (iface->cost != tmp->dist))
1106
	else if ((ifa->state == OSPF_IS_PTP) && (ifa->cost != tmp->dist))
1109 1107
	{
1110
	  iface->cost = tmp->dist;
1108
	  ifa->cost = tmp->dist;
1111 1109
	  schedule_rt_lsa(po->backbone);
1112 1110
	}
1113 1111
      }
1114 1112
      else
1115 1113
      {
1116
        if (iface->state > OSPF_IS_DOWN)
1114
        if (ifa->state > OSPF_IS_DOWN)
1117 1115
        {
1118
          OSPF_TRACE(D_EVENTS, "Vlink peer %R lost", iface->vid);
1119
	  ospf_iface_sm(iface, ISM_DOWN);
1116
          OSPF_TRACE(D_EVENTS, "Vlink peer %R lost", ifa->vid);
1117
	  ospf_iface_sm(ifa, ISM_DOWN);
1120 1118
        }
1121 1119
      }
1122 1120
    }

Also available in: Unified diff