{
char buf[SU_ADDRSTRLEN] = {0};
char dn_flag[2] = {0};
- char neighborAddr[INET6_ADDRSTRLEN] = {0};
+ /* '*' + v6 address of neighbor */
+ char neighborAddr[INET6_ADDRSTRLEN + 1] = {0};
if (!p->conf_if && peer_dynamic_neighbor(p))
dn_flag[0] = '*';
static int get_memory_usage(pid_t pid)
{
int fd, data, stack;
- char buf[4096], status_child[BUFSIZ];
+ char buf[4096], status_child[PATH_MAX];
char *vm;
snprintf(status_child, sizeof(status_child), "/proc/%d/status", pid);
#include <linux/ip.h>
#include <linux/if_arp.h>
#include <linux/if_tunnel.h>
+#include <linux/limits.h>
#include "nhrp_protocol.h"
#include "os.h"
static int linux_icmp_redirect_off(const char *iface)
{
- char fname[256];
+ char fname[PATH_MAX];
int fd, ret = -1;
snprintf(fname, sizeof(fname),
static int pid_is_exec(pid_t pid, const struct stat *esb)
{
struct stat sb;
- char buf[32];
+ char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "/proc/%ld/exe", (long)pid);
if (stat(buf, &sb) != 0)
static int pid_is_user(pid_t pid, uid_t uid)
{
struct stat sb;
- char buf[32];
+ char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "/proc/%ld", (long)pid);
if (stat(buf, &sb) != 0)
static int pid_is_cmd(pid_t pid, const char *name)
{
- char buf[32];
+ char buf[PATH_MAX];
FILE *f;
int c;
static int zebra_ns_notify_self_identify(struct stat *netst)
{
- char net_path[64];
+ char net_path[PATH_MAX];
int netns;
snprintf(net_path, sizeof(net_path), "/proc/self/ns/net");
/* range icmp type */
if (zpie->src_port_max || zpie->dst_port_max) {
- vty_out(vty, ":icmp:[type <%d:%d>;code <%d:%d>",
+ vty_out(vty, ":icmp:[type <%u:%u>;code <%u:%u>",
zpie->src_port_min, zpie->src_port_max,
zpie->dst_port_min, zpie->dst_port_max);
} else {
port = ((zpie->src_port_min << 8) & 0xff00) +
(zpie->dst_port_min & 0xff);
memset(decoded_str, 0, sizeof(decoded_str));
- snprintf(decoded_str, sizeof(decoded_str), "%d/%d",
+ snprintf(decoded_str, sizeof(decoded_str), "%u/%u",
zpie->src_port_min, zpie->dst_port_min);
vty_out(vty, ":icmp:%s",
lookup_msg(icmp_typecode_str,