Revision 5f743d96

View differences:

proto/ospf/dbdes.c
38 38
      op->length=htons(length);
39 39
      ospf_pkt_finalize(ifa, op);
40 40
      sk_send_to(ifa->ip_sk,length, n->ip, OSPF_PROTO);
41
      debug("%s: DB_DES (I) sent for %I.\n", p->name, n->rid);
41
      debug("%s: DB_DES (I) sent to %I.\n", p->name, n->rid);
42 42
      break;
43 43

  
44 44
    case NEIGHBOR_EXCHANGE:
45 45
      n->myimms.bit.i=0;
46

  
46 47
      if(((n->myimms.bit.ms) && (n->dds==n->ddr+1)) ||
47 48
         ((!(n->myimms.bit.ms)) && (n->dds==n->ddr)))
48 49
      {
......
57 58
        pkt->options= ifa->options;
58 59
	pkt->ddseq=htonl(n->dds);
59 60

  
60
	j=i=(ifa->iface->mtu-sizeof(struct ospf_dbdes_packet))/
61
	j=i=(ifa->iface->mtu-sizeof(struct ospf_dbdes_packet)-SIPH)/
61 62
		sizeof(struct ospf_lsa_header);	/* Number of lsaheaders */
62 63
	lsa=(n->ldbdes+sizeof(struct ospf_dbdes_packet));
63 64

  
......
73 74
	    en=(struct top_hash_entry *)sn;
74 75
	    htonlsah(&(en->lsa), lsa);
75 76
	    DBG("Working on: %d\n", i);
76
            debug("\t%04x %08x %08x %p\n", en->lsa.type, en->lsa.id,
77
            DBG("\tX%01x %08I %08I %p\n", en->lsa.type, en->lsa.id,
77 78
              en->lsa.rt, en->lsa_body);
78 79

  
79 80
	    if(sn==STAIL(n->ifa->oa->lsal))
80 81
	    {
81 82
	      break;	/* Should set some flag? */
83
	      i--;
82 84
  	    }
83 85
	    sn=sn->next;
84 86
	    lsa++;
85 87
	  }
86
	  i--;
87 88

  
88 89
	  if(sn==STAIL(n->ifa->oa->lsal))
89 90
	  {
......
91 92
	    DBG("M bit unset.\n");
92 93
	    n->myimms.bit.m=0;	/* Unset more bit */
93 94
	  }
94

  
95
	  s_put(&(n->dbsi),sn);
95
	  else s_put(&(n->dbsi),sn);
96 96
	}
97 97

  
98 98
        pkt->imms.byte=n->myimms.byte;
......
102 102
	op->length=htons(length);
103 103
	
104 104
        ospf_pkt_finalize(ifa, op);
105
        DBG("%s: DB_DES (M) sent to %I.\n", p->name, n->rid);
105 106
      }
106 107

  
107 108
    case NEIGHBOR_LOADING:
108 109
    case NEIGHBOR_FULL:
109

  
110 110
      aa=ifa->ip_sk->tbuf;
111 111
      bb=n->ldbdes;
112 112
      op=n->ldbdes;
113 113
      length=ntohs(op->length);
114 114

  
115
      for(i=0; i<ifa->iface->mtu; i++)
115
      for(i=0; i<length; i++)
116 116
      {
117 117
        *(aa+i)=*(bb+i);	/* Copy last sent packet again */
118 118
      }
119 119

  
120
      {
121
        u8 ii;
122
	u8 *jj=ifa->ip_sk->tbuf;
123

  
124
	for(ii=0;ii<length;ii+=4)
125
	{
126
	  DBG("Out dump: %d,%d,%d,%d\n", *(jj+ii), *(jj+ii+1), *(jj+ii+2), *(jj+ii+3));
127
	}
128
      }
129

  
120
      DBG("%s: DB_DES sending to %I.\n", p->name, n->rid);
130 121
      sk_send_to(ifa->ip_sk,length, n->ip, OSPF_PROTO);
131
      DBG("%s: DB_DES sent to %I.\n", p->name, n->rid);
122
      debug("%s: DB_DES (M) sent to %I.\n", p->name, n->rid);
132 123
      if(n->myimms.bit.ms) tm_start(n->rxmt_timer,ifa->rxmtint);
133 124
      else
134 125
      {
proto/ospf/lsreq.c
119 119
    if(ospf_hash_find(n->ifa->oa->gr, llsh->lsh.id, llsh->lsh.rt,
120 120
      llsh->lsh.type)==NULL)
121 121
    {
122
      debug("Received bad LS req from: %I looking: RT: %I, ID: %I, Type: %u",
123
        n->ip, lsh->rt, lsh->id, lsh->type);
122 124
      ospf_neigh_sm(n,INM_BADLSREQ);
123 125
      rfree(upslab);
124 126
      return;
proto/ospf/lsupd.c
168 168
    en=ospf_hash_find(n->ifa->oa->gr,llsh->lsh.id,llsh->lsh.rt,llsh->lsh.type);
169 169
    DBG("Sending ID=%I, Type=%u, RT=%I\n", llsh->lsh.id, llsh->lsh.type,
170 170
      llsh->lsh.rt);
171
    if((len+sizeof(struct ospf_lsa_header)+en->lsa.length)>n->ifa->iface->mtu)
171
    if((len+en->lsa.length)>n->ifa->iface->mtu)
172 172
    {
173 173
      pk->lsano=htonl(lsano);
174 174
      op->length=htons(len);
proto/ospf/neighbor.c
177 177
          break;
178 178
        case OSPF_IS_DROTHER:
179 179
          if(((n->rid==ifa->drid) || (n->rid==ifa->bdrid))
180
            && (n->state==NEIGHBOR_2WAY)) i=1;
180
            && (n->state>=NEIGHBOR_2WAY)) i=1;
181 181
          break;
182 182
        case OSPF_IS_PTP:
183 183
        case OSPF_IS_BACKUP:
proto/ospf/topology.c
504 504
      struct top_hash_entry *e = f->hash_table[i];
505 505
      while (e)
506 506
	{
507
	  debug("\t%04x %08I %08I %p\n", e->lsa.type, e->lsa.id,
507
	  debug("\t%01x %08I %08I %p\n", e->lsa.type, e->lsa.id,
508 508
            e->lsa.rt, e->lsa_body);
509 509
	  e = e->next;
510 510
	}

Also available in: Unified diff