libvma/libvma-8.0.1-gcc8.patch
2018-02-07 10:45:29 +01:00

190 lines
8.2 KiB
Diff

diff -up libvma-8.0.1/src/stats/stats_publisher.cpp.me libvma-8.0.1/src/stats/stats_publisher.cpp
--- libvma-8.0.1/src/stats/stats_publisher.cpp.me 2018-02-06 17:39:15.618093186 +0100
+++ libvma-8.0.1/src/stats/stats_publisher.cpp 2018-02-06 17:39:54.488171577 +0100
@@ -268,7 +268,7 @@ shmem_error:
g_sh_mem_info.fd_sh_stats = -1;
g_sh_mem_info.p_sh_stats = MAP_FAILED;
g_sh_mem = &g_local_sh_mem;
- memset(g_sh_mem, 0, sizeof(*g_sh_mem));
+ memset(static_cast<void*>(g_sh_mem), 0, sizeof(*g_sh_mem));
*p_p_vma_log_level = &g_sh_mem->log_level;
*p_p_vma_log_details = &g_sh_mem->log_details_level;
BULLSEYE_EXCLUDE_BLOCK_END
@@ -332,7 +332,7 @@ void vma_stats_instance_create_socket_bl
out:
if (p_skt_stats) {
- memset(p_skt_stats, 0, sizeof(*p_skt_stats));
+ memset(static_cast<void*>(p_skt_stats), 0, sizeof(*p_skt_stats));
p_skt_stats->mc_grp_map.reset();
g_p_stats_data_reader->add_data_reader(local_stats_addr, p_skt_stats, sizeof(socket_stats_t));
}
diff -up libvma-8.0.1/src/stats/stats_reader.cpp.me libvma-8.0.1/src/stats/stats_reader.cpp
--- libvma-8.0.1/src/stats/stats_reader.cpp.me 2018-02-06 15:59:12.754199479 +0100
+++ libvma-8.0.1/src/stats/stats_reader.cpp 2018-02-06 16:39:38.406905488 +0100
@@ -1525,8 +1525,10 @@ int init_print_process_stats(sh_mem_inf
sh_mem_t* sh_mem;
int pid = sh_mem_info.pid;
- snprintf(sh_mem_info.filename_sh_stats, sizeof(sh_mem_info.filename_sh_stats), "%s/vmastat.%d", g_vma_shmem_dir, pid);
-
+ //snprintf(sh_mem_info.filename_sh_stats, sizeof(sh_mem_info.filename_sh_stats), "%s/vmastat.%d", g_vma_shmem_dir, pid);
+ const char ib_path_format[] = "%s/vmastat.%d";
+ snprintf(sh_mem_info.filename_sh_stats, sizeof(sh_mem_info.filename_sh_stats), ib_path_format, g_vma_shmem_dir, pid);
+
if (user_params.write_auth)
sh_mem_info.fd_sh_stats = open(sh_mem_info.filename_sh_stats,O_RDWR, S_IRWXU|S_IROTH);
else
diff -up libvma-8.0.1/src/vma/dev/buffer_pool.cpp.me libvma-8.0.1/src/vma/dev/buffer_pool.cpp
--- libvma-8.0.1/src/vma/dev/buffer_pool.cpp.me 2018-02-06 17:18:48.792336254 +0100
+++ libvma-8.0.1/src/vma/dev/buffer_pool.cpp 2018-02-06 17:18:25.927276800 +0100
@@ -166,7 +166,7 @@ buffer_pool::buffer_pool(size_t buffer_c
for (size_t i = 0; i < buffer_count; ++i) {
mem_buf_desc_t* ptr_desc_mbdt = (mem_buf_desc_t*)ptr_desc;
- memset(ptr_desc_mbdt, 0, sizeof (*ptr_desc_mbdt));
+ memset(static_cast<void*>(ptr_desc_mbdt), 0, sizeof (*ptr_desc_mbdt));
mem_buf_desc_t *desc = new (ptr_desc) mem_buf_desc_t(ptr_buff, buf_size);
desc->serial_num = i;
desc->p_desc_owner = owner;
diff -up libvma-8.0.1/src/vma/infra/subject_observer.cpp.me libvma-8.0.1/src/vma/infra/subject_observer.cpp
--- libvma-8.0.1/src/vma/infra/subject_observer.cpp.me 2018-02-06 17:38:01.739951162 +0100
+++ libvma-8.0.1/src/vma/infra/subject_observer.cpp 2018-02-06 17:38:43.712031849 +0100
@@ -52,11 +52,11 @@ bool subject::register_observer(IN const
}
auto_unlocker lock(m_lock);
- if (m_observers.count((observer * const)new_observer) > 0) {
+ if (m_observers.count((observer *)new_observer) > 0) {
// sub_obs_logdbg("[%s] Observer is already registered (%p)", to_str(), new_observer);
return false;
}
- m_observers.insert((observer * const)new_observer);
+ m_observers.insert((observer *)new_observer);
// sub_obs_logdbg("[%s] Successfully registered new_observer %s", to_str(), new_observer->to_str());
return true;
}
@@ -69,7 +69,7 @@ bool subject::unregister_observer(IN con
}
auto_unlocker lock(m_lock);
- m_observers.erase((observer * const)old_observer);
+ m_observers.erase((observer *)old_observer);
// sub_obs_logdbg("[%s] Successfully unregistered old_observer %s",to_str(), old_observer->to_str());
return true;
}
diff -up libvma-8.0.1/src/vma/proto/L2_address.h.me libvma-8.0.1/src/vma/proto/L2_address.h
--- libvma-8.0.1/src/vma/proto/L2_address.h.me 2018-02-06 16:40:59.152129368 +0100
+++ libvma-8.0.1/src/vma/proto/L2_address.h 2018-02-06 16:49:34.787559057 +0100
@@ -59,7 +59,7 @@ public:
void set(address_t const address, addrlen_t const len);
addrlen_t get_addrlen() const { return m_len; };
- address_t get_address() const { return (const address_t)m_p_raw_address; };
+ address_t get_address() const { return (address_t) m_p_raw_address; };
virtual bool compare(L2_address const& other) const;
diff -up libvma-8.0.1/src/vma/proto/mem_buf_desc.h.me libvma-8.0.1/src/vma/proto/mem_buf_desc.h
diff -up libvma-8.0.1/src/vma/proto/route_rule_table_key.h.me libvma-8.0.1/src/vma/proto/route_rule_table_key.h
--- libvma-8.0.1/src/vma/proto/route_rule_table_key.h.me 2018-02-06 17:17:44.241168404 +0100
+++ libvma-8.0.1/src/vma/proto/route_rule_table_key.h 2018-02-06 17:34:50.072582707 +0100
@@ -36,6 +36,7 @@
#include <stdio.h>
#include <string>
+#include <cstring>
#include "vma/util/to_str.h"
#include "vma/util/vtypes.h"
@@ -53,13 +54,18 @@ public:
const std::string to_str() const
{
- char s[100];
+ char s[100] = {0};
sprintf(s, "Destination IP:%d.%d.%d.%d", NIPQUAD(m_dst_ip));
- if (m_src_ip)
- sprintf(s, "%s Source IP:%d.%d.%d.%d", s, NIPQUAD(m_src_ip));
- if (m_tos)
- sprintf(s, "%s TOS:%u", s, m_tos);
-
+ if (m_src_ip) {
+ char sx[40] = {0};
+ sprintf(sx, " Source IP:%d.%d.%d.%d", NIPQUAD(m_src_ip));
+ strcat(s, sx);
+ }
+ if (m_tos) {
+ char sx[20] = {0};
+ sprintf(sx, " TOS:%u", m_tos);
+ strcat(s, sx);
+ }
return(std::string(s));
}
@@ -85,16 +91,22 @@ public:
size_t operator()(const route_rule_table_key &key) const
{
hash<string>_hash;
- char s[40];
+ char s[40] = {0};
/*
Build string from exist parameter (destination IP, source IP, TOS)
which is unique for different route-rule entries.
*/
sprintf(s, "%d.%d.%d.%d", NIPQUAD(key.get_dst_ip()));
- if (key.get_src_ip())
- sprintf(s, "%s %d.%d.%d.%d", s, NIPQUAD(key.get_src_ip()));
- if (key.get_tos())
- sprintf(s, "%s %u", s, key.get_tos());
+ if (key.get_src_ip()) {
+ char sx[20] = {0};
+ sprintf(sx, " %d.%d.%d.%d", NIPQUAD(key.get_src_ip()));
+ strcat(s, sx);
+ }
+ if (key.get_tos()) {
+ char sx[20] = {0};
+ sprintf(sx, " %u", key.get_tos());
+ strcat(s, sx);
+ }
return _hash(std::string(s));// Use built in hash function for string input.
}
};
diff -up libvma-8.0.1/src/vma/sock/pipeinfo.cpp.me libvma-8.0.1/src/vma/sock/pipeinfo.cpp
--- libvma-8.0.1/src/vma/sock/pipeinfo.cpp.me 2018-02-06 17:36:50.905814995 +0100
+++ libvma-8.0.1/src/vma/sock/pipeinfo.cpp 2018-02-06 17:37:33.543896959 +0100
@@ -72,7 +72,7 @@ pipeinfo::pipeinfo(int fd) : socket_fd_a
// pi_logdbg("Got NULL from mce_stats_instance_create_socket_block, using local member");
m_p_socket_stats = &m_socket_stats;
}
- memset(m_p_socket_stats, 0, sizeof(*m_p_socket_stats));
+ memset(static_cast<void*>(m_p_socket_stats), 0, sizeof(*m_p_socket_stats));
m_p_socket_stats->fd = m_fd;
m_p_socket_stats->b_blocking = m_b_blocking;
m_p_socket_stats->n_rx_ready_pkt_count = 0;
diff -up libvma-8.0.1/src/vma/sock/sockinfo.cpp.me libvma-8.0.1/src/vma/sock/sockinfo.cpp
--- libvma-8.0.1/src/vma/sock/sockinfo.cpp.me 2018-02-06 17:35:47.210692547 +0100
+++ libvma-8.0.1/src/vma/sock/sockinfo.cpp 2018-02-06 17:36:07.360731283 +0100
@@ -85,7 +85,7 @@ sockinfo::sockinfo(int fd):
m_p_socket_stats = &m_socket_stats; // Save stats as local copy and allow state publisher to copy from this location
vma_stats_instance_create_socket_block(m_p_socket_stats);
- memset(m_p_socket_stats, 0, sizeof(*m_p_socket_stats));
+ memset(static_cast<void*>(m_p_socket_stats), 0, sizeof(*m_p_socket_stats));
m_p_socket_stats->fd = m_fd;
m_p_socket_stats->inode = fd2inode(m_fd);
m_p_socket_stats->b_blocking = m_b_blocking;
diff -up libvma-8.0.1/src/vma/util/sys_vars.h.me libvma-8.0.1/src/vma/util/sys_vars.h
diff -up libvma-8.0.1/src/vma/util/sock_addr.h.me libvma-8.0.1/src/vma/util/sock_addr.h
--- libvma-8.0.1/src/vma/util/sock_addr.h.me 2018-02-07 04:14:27.942612450 -0500
+++ libvma-8.0.1/src/vma/util/sock_addr.h 2018-02-07 04:25:37.714699564 -0500
@@ -157,7 +157,7 @@ private:
struct sockaddr_in* m_p_sa_in;
char m_str_in_addr[16];
- char m_str_in_port[6];
+ char m_str_in_port[11];
char m_str[22];
void set_str_in_addr() { sprintf(m_str_in_addr, "%d.%d.%d.%d", NIPQUAD(get_in_addr())); set_str(); }