summaryrefslogtreecommitdiff
path: root/isisd/isis_pdu.c
diff options
context:
space:
mode:
authorpaul <paul>2005-05-03 09:27:23 +0000
committerpaul <paul>2005-05-03 09:27:23 +0000
commit15935e9ae1619288f0f78fcc0dac15c1c25d41c6 (patch)
tree5a12ca48a8d3619f634134744abb0cf6e5f9a589 /isisd/isis_pdu.c
parent0dab930314e215a627f848ffa824ed995eb2e13c (diff)
2005-05-03 Paul Jakma <paul@dishone.st>
* (general) More cleaning up of stream abuse, isisd should be back to previous functionality. Replace various XMALLOC+memset's with XCALLOC * isis_tlv.c: (tlv_add_padding) use stream_put to clear the stream rather than forward endp, as isisd reuses streams. * isis_pdu.c: (process_lsp) cleanup direct reference to stream endp (send_lsp) manual copy of a stream cleaned up to use stream_copy. * isis_network.c: (isis_recv_pdu_bcast) replace direct memcpy with stream_write (isis_recv_pdu_p2p) replace recvfrom directly into stream with stream_recvfrom. Remove dangerous and now unneeded manual update of endp. (isis_recv_pdu_bcast / non-GNU_LINUX) Replace direct memcpy with stream_write. (isis_recv_pdu_p2p) replace read direct into stream with stream_read_try, and hence remove the manual update of endp. * isis_lsp.c: (lsp_update_data) manual stream dup replaced with stream_dup. (lsppdu_realloc) mempcy into stream data replaced with stream_put. (lsp_build_nonpseudo) remove mysterious stream_forward_endp's - which were originally stream_set_putp - shouldn't be needed now that all the manual fiddling of private stream data has been corrected. (build_topology_lsp_data) remove unneeded twiddling of endp, appears to be due to lsppdu_realloc(), but it appears to sort of do the right thing wrt streams.
Diffstat (limited to 'isisd/isis_pdu.c')
-rw-r--r--isisd/isis_pdu.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c
index 9d3b18ad..b83c6339 100644
--- a/isisd/isis_pdu.c
+++ b/isisd/isis_pdu.c
@@ -949,7 +949,8 @@ process_lsp (int level, struct isis_circuit *circuit, u_char * ssnpa)
ntohl (hdr->seq_num),
ntohs (hdr->checksum),
ntohs (hdr->rem_lifetime),
- circuit->rcv_stream->endp, circuit->interface->name);
+ stream_get_endp (circuit->rcv_stream),
+ circuit->interface->name);
}
assert (ntohs (hdr->pdu_len) > ISIS_LSP_HDR_LEN);
@@ -2497,9 +2498,7 @@ send_lsp (struct thread *thread)
circuit->interface->name);
}
/* copy our lsp to the send buffer */
- circuit->snd_stream->getp = lsp->pdu->getp;
- circuit->snd_stream->endp = lsp->pdu->endp;
- memcpy (circuit->snd_stream->data, lsp->pdu->data, lsp->pdu->endp);
+ stream_copy (circuit->snd_stream, lsp->pdu);
retval = circuit->tx (circuit, lsp->level);