Revision 5f743d96 proto/ospf/dbdes.c

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
      {

Also available in: Unified diff