diff options
author | Ondrej Filip <feela@network.cz> | 2004-06-26 20:15:34 +0000 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2004-06-26 20:15:34 +0000 |
commit | 3e2bd0f17aab3d2bd460d5f7aef4d3bc152ea1ab (patch) | |
tree | e6be2d6e0af3d2b67fccf4eca6516e3c6a1a1e92 /proto/ospf/dbdes.c | |
parent | 5236fb03afecd3d7a6ec6e96712c79a31be32132 (diff) |
Md5 authentification added (unsested).
Packet receiving clean up.
Diffstat (limited to 'proto/ospf/dbdes.c')
-rw-r--r-- | proto/ospf/dbdes.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/proto/ospf/dbdes.c b/proto/ospf/dbdes.c index c345858b..7bc87c50 100644 --- a/proto/ospf/dbdes.c +++ b/proto/ospf/dbdes.c @@ -38,15 +38,14 @@ ospf_dbdes_send(struct ospf_neighbor *n) n->myimms.bit.i = 1; pkt = (struct ospf_dbdes_packet *) (ifa->ip_sk->tbuf); op = (struct ospf_packet *) pkt; - fill_ospf_pkt_hdr(ifa, pkt, DBDES_P); + ospf_pkt_fill_hdr(ifa, pkt, DBDES_P); pkt->iface_mtu = htons(ifa->iface->mtu); pkt->options = ifa->options; pkt->imms = n->myimms; pkt->ddseq = htonl(n->dds); length = sizeof(struct ospf_dbdes_packet); op->length = htons(length); - ospf_pkt_finalize(ifa, op); - ospf_send_to(ifa->ip_sk, length, n->ip); + ospf_send_to(ifa->ip_sk, n->ip, ifa); OSPF_TRACE(D_PACKETS, "DB_DES (I) sent to %I via %s.", n->ip, ifa->iface->name); break; @@ -63,12 +62,12 @@ ospf_dbdes_send(struct ospf_neighbor *n) pkt = n->ldbdes; op = (struct ospf_packet *) pkt; - fill_ospf_pkt_hdr(ifa, pkt, DBDES_P); + ospf_pkt_fill_hdr(ifa, pkt, DBDES_P); pkt->iface_mtu = htons(ifa->iface->mtu); pkt->options = ifa->options; pkt->ddseq = htonl(n->dds); - j = i = (ifa->iface->mtu - sizeof(struct ospf_dbdes_packet) - SIPH) / sizeof(struct ospf_lsa_header); /* Number of possible lsaheaders to send */ + j = i = (ospf_pkt_maxsize(ifa) - sizeof(struct ospf_dbdes_packet)) / sizeof(struct ospf_lsa_header); /* Number of possible lsaheaders to send */ lsa = (n->ldbdes + sizeof(struct ospf_dbdes_packet)); if (n->myimms.bit.m) @@ -117,7 +116,6 @@ ospf_dbdes_send(struct ospf_neighbor *n) sizeof(struct ospf_dbdes_packet); op->length = htons(length); - ospf_pkt_finalize(ifa, op); DBG("%s: DB_DES (M) prepared for %I.\n", p->name, n->ip); } @@ -136,7 +134,7 @@ ospf_dbdes_send(struct ospf_neighbor *n) memcpy(ifa->ip_sk->tbuf, n->ldbdes, length); /* Copy last sent packet again */ - ospf_send_to(ifa->ip_sk, length, n->ip); + ospf_send_to(ifa->ip_sk, n->ip, n->ifa); if(n->myimms.bit.ms) tm_start(n->rxmt_timer, n->ifa->rxmtint); /* Restart timer */ |