aboutgitcodebugslistschat
path: root/dhcpv6.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2022-03-26 07:23:21 +0100
committerStefano Brivio <sbrivio@redhat.com>2022-03-29 15:35:38 +0200
commit48582bf47f5ef7a1bf136ca455d182addad08028 (patch)
treeaf17ec9ede424ec7931731fc13af914da13dcbb3 /dhcpv6.c
parent965f603238a92b6ab8cd8a0592e0fb65c096b3e1 (diff)
downloadpasst-48582bf47f5ef7a1bf136ca455d182addad08028.tar
passt-48582bf47f5ef7a1bf136ca455d182addad08028.tar.gz
passt-48582bf47f5ef7a1bf136ca455d182addad08028.tar.bz2
passt-48582bf47f5ef7a1bf136ca455d182addad08028.tar.lz
passt-48582bf47f5ef7a1bf136ca455d182addad08028.tar.xz
passt-48582bf47f5ef7a1bf136ca455d182addad08028.tar.zst
passt-48582bf47f5ef7a1bf136ca455d182addad08028.zip
treewide: Mark constant references as const
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'dhcpv6.c')
-rw-r--r--dhcpv6.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/dhcpv6.c b/dhcpv6.c
index 5c9ea88..4124a3e 100644
--- a/dhcpv6.c
+++ b/dhcpv6.c
@@ -297,7 +297,8 @@ static struct resp_not_on_link_t {
*
* Return: pointer to option header, or NULL on malformed or missing option
*/
-static struct opt_hdr *dhcpv6_opt(struct pool *p, size_t *offset, uint16_t type)
+static struct opt_hdr *dhcpv6_opt(const struct pool *p, size_t *offset,
+ uint16_t type)
{
struct opt_hdr *o;
size_t left;
@@ -322,13 +323,13 @@ static struct opt_hdr *dhcpv6_opt(struct pool *p, size_t *offset, uint16_t type)
/**
* dhcpv6_ia_notonlink() - Check if any IA contains non-appropriate addresses
- * @o: First option header to check for IAs
- * @rem_len: Remaining message length, host order
- * @addr: Address we want to lease to the client
+ * @p: Packet pool, single packet starting from UDP header
+ * @la: Address we want to lease to the client
*
* Return: pointer to non-appropriate IA_NA or IA_TA, if any, NULL otherwise
*/
-static struct opt_hdr *dhcpv6_ia_notonlink(struct pool *p, struct in6_addr *la)
+static struct opt_hdr *dhcpv6_ia_notonlink(const struct pool *p,
+ struct in6_addr *la)
{
char buf[INET6_ADDRSTRLEN];
struct in6_addr *req_addr;
@@ -379,7 +380,7 @@ ia_ta:
*
* Return: updated length of response message buffer.
*/
-static size_t dhcpv6_dns_fill(struct ctx *c, char *buf, int offset)
+static size_t dhcpv6_dns_fill(const struct ctx *c, char *buf, int offset)
{
struct opt_dns_servers *srv = NULL;
struct opt_dns_search *srch = NULL;
@@ -447,7 +448,7 @@ search:
*
* Return: 0 if it's not a DHCPv6 message, 1 if handled, -1 on failure
*/
-int dhcpv6(struct ctx *c, struct pool *p,
+int dhcpv6(struct ctx *c, const struct pool *p,
const struct in6_addr *saddr, const struct in6_addr *daddr)
{
struct opt_hdr *ia, *bad_ia, *client_id, *server_id;
@@ -588,7 +589,7 @@ int dhcpv6(struct ctx *c, struct pool *p,
* dhcpv6_init() - Initialise DUID and addresses for DHCPv6 server
* @c: Execution context
*/
-void dhcpv6_init(struct ctx *c)
+void dhcpv6_init(const struct ctx *c)
{
time_t y2k = 946684800; /* Epoch to 2000-01-01T00:00:00Z, no mktime() */
uint32_t duid_time;