From 48582bf47f5ef7a1bf136ca455d182addad08028 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Sat, 26 Mar 2022 07:23:21 +0100 Subject: treewide: Mark constant references as const Signed-off-by: Stefano Brivio --- dhcp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'dhcp.c') diff --git a/dhcp.c b/dhcp.c index 7f2191d..32dee56 100644 --- a/dhcp.c +++ b/dhcp.c @@ -178,7 +178,8 @@ static int fill(struct msg *m) * * Return: offset to corresponding compression pointer if any, -1 if not found */ -static int opt_dns_search_dup_ptr(unsigned char *buf, char *cmp, size_t len) +static int opt_dns_search_dup_ptr(unsigned char *buf, const char *cmp, + size_t len) { unsigned int i; @@ -202,7 +203,7 @@ static int opt_dns_search_dup_ptr(unsigned char *buf, char *cmp, size_t len) * @c: Execution context * @max_len: Maximum total length of option buffer */ -static void opt_set_dns_search(struct ctx *c, size_t max_len) +static void opt_set_dns_search(const struct ctx *c, size_t max_len) { char buf[NS_MAXDNAME]; int i; @@ -215,7 +216,7 @@ static void opt_set_dns_search(struct ctx *c, size_t max_len) for (i = 0; *c->dns_search[i].n; i++) { unsigned int n; int count = -1; - char *p; + const char *p; buf[0] = 0; for (p = c->dns_search[i].n, n = 1; *p; p++) { @@ -263,7 +264,7 @@ static void opt_set_dns_search(struct ctx *c, size_t max_len) * * Return: 0 if it's not a DHCP message, 1 if handled, -1 on failure */ -int dhcp(struct ctx *c, struct pool *p) +int dhcp(const struct ctx *c, const struct pool *p) { size_t mlen, len, offset = 0, opt_len, opt_off = 0; struct ethhdr *eh; -- cgit v1.2.3