From: Renato Westphal Date: Fri, 4 Jan 2019 21:08:10 +0000 (-0200) Subject: lib: constify a few parameters in the VRF code X-Git-Tag: 7.1_pulled~99^2~15 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=02fe07c7b8f2191d1f53b31888e95d6c12c48ad9;p=matthieu%2Ffrr.git lib: constify a few parameters in the VRF code Parameters should be const whenever possible to improve code readability and remove the need to cast away the constness of const arguments. Signed-off-by: Renato Westphal --- diff --git a/lib/vrf.c b/lib/vrf.c index 0c82f6a3cd..e1f27b7e72 100644 --- a/lib/vrf.c +++ b/lib/vrf.c @@ -572,7 +572,7 @@ static int vrf_default_accepts_vrf(int type) /* Create a socket for the VRF. */ int vrf_socket(int domain, int type, int protocol, vrf_id_t vrf_id, - char *interfacename) + const char *interfacename) { int ret, save_errno, ret2; @@ -947,7 +947,7 @@ vrf_id_t vrf_get_default_id(void) return VRF_DEFAULT_INTERNAL; } -int vrf_bind(vrf_id_t vrf_id, int fd, char *name) +int vrf_bind(vrf_id_t vrf_id, int fd, const char *name) { int ret = 0; @@ -1006,7 +1006,7 @@ int vrf_ioctl(vrf_id_t vrf_id, int d, unsigned long request, char *params) } int vrf_sockunion_socket(const union sockunion *su, vrf_id_t vrf_id, - char *interfacename) + const char *interfacename) { int ret, save_errno, ret2; diff --git a/lib/vrf.h b/lib/vrf.h index fe4fc77250..eacbaf542b 100644 --- a/lib/vrf.h +++ b/lib/vrf.h @@ -215,12 +215,12 @@ extern void vrf_terminate(void); /* Create a socket serving for the given VRF */ extern int vrf_socket(int domain, int type, int protocol, vrf_id_t vrf_id, - char *name); + const char *name); extern int vrf_sockunion_socket(const union sockunion *su, vrf_id_t vrf_id, - char *name); + const char *name); -extern int vrf_bind(vrf_id_t vrf_id, int fd, char *name); +extern int vrf_bind(vrf_id_t vrf_id, int fd, const char *name); /* VRF ioctl operations */ extern int vrf_getaddrinfo(const char *node, const char *service,