summaryrefslogtreecommitdiffstats
path: root/proto/ospf/hello.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2004-06-06 21:53:52 +0200
committerOndrej Filip <feela@network.cz>2004-06-06 21:53:52 +0200
commit5e3436d20ffdd95a164ffcb82f584fad76fb94e7 (patch)
treea9531cf1fe9bea7c8dacf41277b8793f76a62506 /proto/ospf/hello.c
parentd5d9693ce90c190ca7358b4ac71b9d034603a3ae (diff)
downloadbird-5e3436d20ffdd95a164ffcb82f584fad76fb94e7.tar
bird-5e3436d20ffdd95a164ffcb82f584fad76fb94e7.zip
Cleanup in packet.c. Deleted unused parameters.
Diffstat (limited to 'proto/ospf/hello.c')
-rw-r--r--proto/ospf/hello.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/proto/ospf/hello.c b/proto/ospf/hello.c
index 6e1fa92..a318a67 100644
--- a/proto/ospf/hello.c
+++ b/proto/ospf/hello.c
@@ -10,18 +10,14 @@
void
ospf_hello_receive(struct ospf_hello_packet *ps,
- struct ospf_iface *ifa, int size, ip_addr faddr)
+ struct ospf_iface *ifa, struct ospf_neighbor *n, ip_addr faddr)
{
- u32 nrid, *pnrid;
- struct ospf_neighbor *n;
- u8 i, twoway, oldpriority;
+ u32 *pnrid;
ip_addr olddr, oldbdr;
ip_addr mask;
char *beg = "Bad OSPF hello packet from ", *rec = " received: ";
- int eligible = 0;
struct proto *p = (struct proto *) ifa->proto;
-
- nrid = ntohl(((struct ospf_packet *) ps)->routerid);
+ unsigned int size = ntohs(ps->ospf_packet.length), i, twoway, oldpriority, eligible = 0;
OSPF_TRACE(D_PACKETS, "Received hello from %I via %s", faddr,
ifa->iface->name);
@@ -30,7 +26,7 @@ ospf_hello_receive(struct ospf_hello_packet *ps,
if ((unsigned) ipa_mklen(mask) != ifa->iface->addr->pxlen)
{
- log(L_ERR, "%s%I%sbad netmask %I.", beg, nrid, rec, mask);
+ log(L_ERR "%s%I%sbad netmask %I.", beg, faddr, rec, mask);
return;
}
@@ -54,7 +50,7 @@ ospf_hello_receive(struct ospf_hello_packet *ps,
return;
}
- if ((n = find_neigh(ifa, nrid)) == NULL)
+ if (!n)
{
if ((ifa->type == OSPF_IT_NBMA))
{
@@ -92,7 +88,7 @@ ospf_hello_receive(struct ospf_hello_packet *ps,
n = ospf_neighbor_new(ifa);
- n->rid = nrid;
+ n->rid = ntohl(((struct ospf_packet *) ps)->routerid);
n->ip = faddr;
n->dr = ps->dr;
ipa_ntoh(n->dr);