diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-03-23 08:41:17 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-03-23 08:41:17 -0400 |
| commit | 1be1693edfd6411c8f1575204a0c4bd8273c8179 (patch) | |
| tree | 1efb84222dcdd31ad3b52d10c0eab872a431bc12 /lib/stream.h | |
| parent | b8685f9beab3bccd3a0319bd11bbcbc93417766c (diff) | |
bgpd, lib: More `const`ification of various code
More second order effects of cleaning up rn usage
in bgp. Sprinkle the fairy const's all over the place.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/stream.h')
| -rw-r--r-- | lib/stream.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/stream.h b/lib/stream.h index 36c65afa3c..425f0c5edd 100644 --- a/lib/stream.h +++ b/lib/stream.h @@ -354,9 +354,10 @@ extern void stream_fifo_free(struct stream_fifo *fifo); * bit), for 64-bit values (you need to cast them anyway), and neither for * encoding (because it's downcasted.) */ -static inline uint8_t *ptr_get_be32(uint8_t *ptr, uint32_t *out) +static inline const uint8_t *ptr_get_be32(const uint8_t *ptr, uint32_t *out) { uint32_t tmp; + memcpy(&tmp, ptr, sizeof(tmp)); *out = ntohl(tmp); return ptr + 4; |
