diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2010-02-11 10:23:35 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2010-02-11 10:23:35 +0100 |
commit | 353729f513aa6a1f9e7f66083a0f9d2117fe2be5 (patch) | |
tree | 2ce53e3f1b1eb40b852de490db8a65eb681fadfd /proto/ospf/lsupd.c | |
parent | 75f8861898d53f43cb23dbba9c776bce223c18c8 (diff) |
Temporary OSPF commit - socket changes.
Diffstat (limited to 'proto/ospf/lsupd.c')
-rw-r--r-- | proto/ospf/lsupd.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c index 9bed374e..133a036d 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(); + 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; |