Revision 9669362f proto/ospf/lsreq.c

View differences:

proto/ospf/lsreq.c
18 18
  struct ospf_lsreq_header *lsh;
19 19
  u16 length;
20 20
  int i,j;
21
  struct proto *p=&n->ifa->proto->proto;
21 22

  
22 23
  pk=(struct ospf_lsreq_packet *)n->ifa->ip_sk->tbuf;
23 24
  op=(struct ospf_packet *)n->ifa->ip_sk->tbuf;
......
54 55
  op->length=htons(length);
55 56
  ospf_pkt_finalize(n->ifa, op);
56 57
  sk_send_to(n->ifa->ip_sk,length, n->ip, OSPF_PROTO);
57
  DBG("Lsreq send to: %I\n", n->rid);
58
  debug("%s: LS request sent to: %I\n", p->name, n->rid);
58 59
}
59 60

  
60 61
void
......
63 64
  struct ospf_iface *ifa;
64 65
  struct proto *p;
65 66
  struct ospf_neighbor *n;
67
  struct top_hash_entry *en;
66 68

  
67 69
  n=(struct ospf_neighbor *)timer->data;
68 70
  ifa=n->ifa;
69 71
  p=(struct proto *)(ifa->proto);
70
  debug("%s: LSRR timer fired on interface %s for neigh: %I.\n",
72

  
73
  DBG("%s: LSRR timer fired on interface %s for neigh: %I.\n",
71 74
    p->name, ifa->iface->name, n->rid);
72 75
  if(n->state<NEIGHBOR_FULL) ospf_lsreq_tx(n);
73 76
  else
74 77
  {
75
    int i;	/* FIXME Retransmit lsupd again */
78
    if(!EMPTY_SLIST(n->lsrtl))
79
    {
80
      list uplist;
81
      slab *upslab;
82
      struct l_lsr_head *llsh;
83

  
84
      init_list(&uplist);
85
      upslab=sl_new(p->pool,sizeof(struct l_lsr_head));
86

  
87
      WALK_SLIST(SNODE en,n->lsrtl)
88
      {
89
	if((SNODE en)->next==(SNODE en)) die("BUGGGGGG");
90
        llsh=sl_alloc(upslab);
91
        llsh->lsh.id=en->lsa.id;
92
        llsh->lsh.rt=en->lsa.rt;
93
        llsh->lsh.type=en->lsa.type;
94
	DBG("Working on ID: %I, RT: %I, Type: %u\n",en->lsa.id,en->lsa.rt,en->lsa.type);
95
        add_tail(&uplist, NODE llsh);
96
      }
97
      ospf_lsupd_tx_list(n, &uplist);
98
      rfree(upslab);
99
    }
76 100
  }
77 101
}
78 102

  
......
95 119

  
96 120
  if((n=find_neigh(ifa, nrid))==NULL)
97 121
  {
98
    debug("%s: Received lsreq from unknown neigbor! (%I)\n", p->name,
122
    debug("%s: Received lsreq from unknown neighbor! (%I)\n", p->name,
99 123
      nrid);
100 124
    return ;
101 125
  }
102
  if(n->state<NEIGHBOR_EXCHANGE) debug("%s: Ignoring it.\n", p->name);
126
  if(n->state<NEIGHBOR_EXCHANGE) return;
127

  
128
  debug("%s: Received LS req from neighbor: %I\n",p->name, n->ip);
103 129

  
104 130
  length=htons(ps->ospf_packet.length);
105 131
  lsh=(void *)(ps+1);

Also available in: Unified diff