1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Temporary OSPF commit - socket changes.

This commit is contained in:
Ondrej Zajicek
2010-02-11 10:23:35 +01:00
parent 75f8861898
commit 353729f513
18 changed files with 615 additions and 295 deletions

View File

@@ -269,8 +269,8 @@ ospf_lsupd_flood(struct proto_ospf *po,
struct ospf_packet *op;
struct ospf_lsa_header *lh;
pk = (struct ospf_lsupd_packet *) ifa->sk->tbuf;
op = (struct ospf_packet *) ifa->sk->tbuf;
pk = ospf_tx_buffer();
op = &pk->ospf_packet;
ospf_pkt_fill_hdr(ifa, pk, LSUPD_P);
pk->lsano = htonl(1);
@@ -304,8 +304,7 @@ ospf_lsupd_flood(struct proto_ospf *po,
op->length = htons(len);
OSPF_PACKET(ospf_dump_lsupd, (struct ospf_lsupd_packet *) ifa->sk->tbuf,
"LSUPD packet flooded via %s", ifa->iface->name);
OSPF_PACKET(ospf_dump_lsupd, pk, "LSUPD packet flooded via %s", ifa->iface->name);
switch (ifa->type)
{
@@ -349,11 +348,11 @@ ospf_lsupd_send_list(struct ospf_neighbor *n, list * l)
if (EMPTY_LIST(*l))
return;
pk = (struct ospf_lsupd_packet *) n->ifa->sk->tbuf;
op = (struct ospf_packet *) n->ifa->sk->tbuf;
DBG("LSupd: 1st packet\n");
pk= ospf_tx_buffer();
op = &pk->ospf_packet;
ospf_pkt_fill_hdr(n->ifa, pk, LSUPD_P);
len = sizeof(struct ospf_lsupd_packet);
lsano = 0;
@@ -374,8 +373,7 @@ ospf_lsupd_send_list(struct ospf_neighbor *n, list * l)
pk->lsano = htonl(lsano);
op->length = htons(len);
OSPF_PACKET(ospf_dump_lsupd, (struct ospf_lsupd_packet *) n->ifa->sk->tbuf,
"LSUPD packet sent to %I via %s", n->ip, n->ifa->iface->name);
OSPF_PACKET(ospf_dump_lsupd, pk, "LSUPD packet sent to %I via %s", n->ip, n->ifa->iface->name);
ospf_send_to(n->ifa, n->ip);
DBG("LSupd: next packet\n");
@@ -397,8 +395,7 @@ ospf_lsupd_send_list(struct ospf_neighbor *n, list * l)
pk->lsano = htonl(lsano);
op->length = htons(len);
OSPF_PACKET(ospf_dump_lsupd, (struct ospf_lsupd_packet *) n->ifa->sk->tbuf,
"LSUPD packet sent to %I via %s", n->ip, n->ifa->iface->name);
OSPF_PACKET(ospf_dump_lsupd, pk, "LSUPD packet sent to %I via %s", n->ip, n->ifa->iface->name);
ospf_send_to(n->ifa, n->ip);
}
}
@@ -416,7 +413,7 @@ ospf_lsupd_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
unsigned int size = ntohs(ps_i->length);
if (size < (sizeof(struct ospf_lsupd_packet) + sizeof(struct ospf_lsa_header)))
{
log(L_ERR "Bad OSPF LSUPD packet from %I - too short (%u B)", n->ip, size);
log(L_ERR "OSPF: Bad LSUPD packet from %I - too short (%u B)", n->ip, size);
return;
}
@@ -537,7 +534,7 @@ ospf_lsupd_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
{
if (!nifa->iface)
continue;
if (ipa_equal(nifa->iface->addr->ip, ipa_from_u32(lsatmp.id)))
if (ipa_equal(nifa->addr->ip, ipa_from_u32(lsatmp.id)))
{
self = 1;
break;