From 3f4e64edc0583261be0b61204a0eac6df319e641 Mon Sep 17 00:00:00 2001 From: Simon Giesecke Date: Mon, 4 Feb 2019 07:29:43 -0500 Subject: [PATCH] Problem: bind_to_device unnecessarily accepts a non-const string parameter Solution: add const --- src/ip.cpp | 2 +- src/ip.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ip.cpp b/src/ip.cpp index a3a8e220..ba2e7290 100644 --- a/src/ip.cpp +++ b/src/ip.cpp @@ -237,7 +237,7 @@ int zmq::set_nosigpipe (fd_t s_) return 0; } -void zmq::bind_to_device (fd_t s_, std::string &bound_device_) +void zmq::bind_to_device (fd_t s_, const std::string &bound_device_) { #ifdef ZMQ_HAVE_SO_BINDTODEVICE int rc = setsockopt (s_, SOL_SOCKET, SO_BINDTODEVICE, diff --git a/src/ip.hpp b/src/ip.hpp index 9f4f1ed5..9f0e153c 100644 --- a/src/ip.hpp +++ b/src/ip.hpp @@ -56,7 +56,7 @@ void set_ip_type_of_service (fd_t s_, int iptos_); int set_nosigpipe (fd_t s_); // Binds the underlying socket to the given device, eg. VRF or interface -void bind_to_device (fd_t s_, std::string &bound_device_); +void bind_to_device (fd_t s_, const std::string &bound_device_); // Initialize network subsystem. May be called multiple times. Each call must be matched by a call to shutdown_network. bool initialize_network ();