Revision 351feeb5 proto/ospf/packet.c

View differences:

proto/ospf/packet.c
1 1
/*
2 2
 *	BIRD -- OSPF
3 3
 *
4
 *	(c) 1999 Ondrej Filip <feela@network.cz>
4
 *	(c) 1999 - 2000 Ondrej Filip <feela@network.cz>
5 5
 *
6 6
 *	Can be freely distributed and used under the terms of the GNU GPL.
7 7
 */
......
65 65
    (pkt+1),ntohs(pkt->length)-sizeof(struct ospf_packet),NULL);
66 66
}
67 67

  
68
/**
69
 * ospf_rx_hook
70
 * @sk: socket we recived the packet. Its ignored.
71
 * @size: size of the packet
72
 *
73
 * This in entry point for messages from neighbors. Many checks (like
74
 * autnetication, checksums, size) are done before packet is passed to
75
 * non generic functions.
76
 */
68 77
int
69 78
ospf_rx_hook(sock *sk, int size)
70 79
{
......
120 129
    return(1);
121 130
  }
122 131

  
123

  
124 132
  if(ps->areaid!=ifa->an)
125 133
  {
126 134
    log("%s: Bad OSPF packet received: other area %ld", p->name, ps->areaid);
......
130 138

  
131 139
  if(ntohl(ps->routerid)==p->cf->global->router_id)
132 140
  {
133
    log("%s: Bad OSPF packet received: received my own IP!.", p->name);
141
    log("%s: Bad OSPF packet received: received my own router ID!", p->name);
134 142
    log("%s: Discarding",p->name);
135 143
    return(1);
136 144
  }
......
142 150
    return(1);
143 151
  }
144 152
  
145
  /* Dump packet */
153
  /* Dump packet 
146 154
  pu8=(u8 *)(sk->rbuf+5*4);
147 155
  for(i=0;i<ntohs(ps->length);i+=4)
148 156
    DBG("%s: received %u,%u,%u,%u\n",p->name, pu8[i+0], pu8[i+1], pu8[i+2],
149 157
		    pu8[i+3]);
150 158
  DBG("%s: received size: %u\n",p->name,size);
159
  */
151 160

  
152 161
  switch(ps->type)
153 162
  {
......
173 182
      break;
174 183
    default:
175 184
      log("%s: Bad packet received: wrong type %u", p->name, ps->type);
176
      log("%s: Discarding",p->name);
185
      log("%s: Discarding\n",p->name);
177 186
      return(1);
178 187
  };
179
  DBG("\n");
180 188
#else
181 189
#error RX_Hook does not work for IPv6 now.
182 190
#endif

Also available in: Unified diff