summaryrefslogtreecommitdiffstats
path: root/proto/ospf/lsupd.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-03-26 18:53:31 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2010-03-26 18:53:31 +0100
commiteb0f129fcedcecbee85403095abad8f59b82683c (patch)
tree562179cf65bcdcfe1fc2ea42b401ddce620de350 /proto/ospf/lsupd.c
parentb1c030b0ba59eed6da5271ed592d6b93ed088518 (diff)
parent48cff379a718998cd984d60fb6f8b48cb961c0f1 (diff)
downloadbird-eb0f129fcedcecbee85403095abad8f59b82683c.tar
bird-eb0f129fcedcecbee85403095abad8f59b82683c.zip
Merge branch 'socket2' into new
Diffstat (limited to 'proto/ospf/lsupd.c')
-rw-r--r--proto/ospf/lsupd.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c
index 628dca9..7d5d89d 100644
--- a/proto/ospf/lsupd.c
+++ b/proto/ospf/lsupd.c
@@ -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(ifa);
+ op = &pk->ospf_packet;
ospf_pkt_fill_hdr(ifa, pk, LSUPD_P);
pk->lsano = htonl(1);
@@ -303,8 +303,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)
{
@@ -348,11 +347,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(n->ifa);
+ op = &pk->ospf_packet;
+
ospf_pkt_fill_hdr(n->ifa, pk, LSUPD_P);
len = sizeof(struct ospf_lsupd_packet);
lsano = 0;
@@ -373,8 +372,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");
@@ -395,8 +393,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);
}
}
@@ -414,7 +411,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;
}
@@ -535,7 +532,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;