From 15935e9ae1619288f0f78fcc0dac15c1c25d41c6 Mon Sep 17 00:00:00 2001 From: paul Date: Tue, 3 May 2005 09:27:23 +0000 Subject: 2005-05-03 Paul Jakma * (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. --- isisd/isis_tlv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'isisd/isis_tlv.c') diff --git a/isisd/isis_tlv.c b/isisd/isis_tlv.c index 3dae5d89..1194f046 100644 --- a/isisd/isis_tlv.c +++ b/isisd/isis_tlv.c @@ -1069,7 +1069,7 @@ tlv_add_padding (struct stream *stream) goto err; if (!stream_putc (stream, (u_char) 255)) /* LENGHT */ goto err; - stream_forward_endp (stream, 255); /* VALUE */ + stream_put (stream, NULL, 255); /* zero padding */ } left = STREAM_SIZE (stream) - stream_get_endp (stream); @@ -1086,7 +1086,7 @@ tlv_add_padding (struct stream *stream) stream_putc (stream, PADDING); stream_putc (stream, left - 2); - stream_forward_endp (stream, left - 2); + stream_put (stream, NULL, left-2); return ISIS_OK; -- cgit v1.2.1