summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_mpath.c4
-rw-r--r--lib/hash.c1
-rw-r--r--ripngd/ripngd.c16
-rw-r--r--tools/start-stop-daemon.c5
-rw-r--r--vtysh/vtysh.c5
-rw-r--r--zebra/rtadv.c1
6 files changed, 20 insertions, 12 deletions
diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c
index d3ee140bb4..9d32c4bee1 100644
--- a/bgpd/bgp_mpath.c
+++ b/bgpd/bgp_mpath.c
@@ -751,6 +751,10 @@ void bgp_info_mpath_aggregate_update(struct bgp_info *new_best,
attr.ecommunity = ecomm;
attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
}
+ if (lcomm) {
+ attr.lcommunity = lcomm;
+ attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES);
+ }
/* Zap multipath attr nexthop so we set nexthop to self */
attr.nexthop.s_addr = 0;
diff --git a/lib/hash.c b/lib/hash.c
index f222279216..4894b65aff 100644
--- a/lib/hash.c
+++ b/lib/hash.c
@@ -395,6 +395,7 @@ DEFUN_NOSH(show_hash_stats,
pthread_mutex_lock(&_hashes_mtx);
if (!_hashes) {
pthread_mutex_unlock(&_hashes_mtx);
+ ttable_del(tt);
vty_out(vty, "No hash tables in use.\n");
return CMD_SUCCESS;
}
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index daa2526a0c..673f0637c7 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -101,21 +101,21 @@ static int ripng_make_socket(void)
setsockopt_so_recvbuf(sock, 8096);
ret = setsockopt_ipv6_pktinfo(sock, 1);
if (ret < 0)
- return ret;
+ goto error;
#ifdef IPTOS_PREC_INTERNETCONTROL
ret = setsockopt_ipv6_tclass(sock, IPTOS_PREC_INTERNETCONTROL);
if (ret < 0)
- return ret;
+ goto error;
#endif
ret = setsockopt_ipv6_multicast_hops(sock, 255);
if (ret < 0)
- return ret;
+ goto error;
ret = setsockopt_ipv6_multicast_loop(sock, 0);
if (ret < 0)
- return ret;
+ goto error;
ret = setsockopt_ipv6_hoplimit(sock, 1);
if (ret < 0)
- return ret;
+ goto error;
memset(&ripaddr, 0, sizeof(ripaddr));
ripaddr.sin6_family = AF_INET6;
@@ -132,11 +132,15 @@ static int ripng_make_socket(void)
zlog_err("Can't bind ripng socket: %s.", safe_strerror(errno));
if (ripngd_privs.change(ZPRIVS_LOWER))
zlog_err("ripng_make_socket: could not lower privs");
- return ret;
+ goto error;
}
if (ripngd_privs.change(ZPRIVS_LOWER))
zlog_err("ripng_make_socket: could not lower privs");
return sock;
+
+error:
+ close(sock);
+ return ret;
}
/* Send RIPng packet. */
diff --git a/tools/start-stop-daemon.c b/tools/start-stop-daemon.c
index 30dc6484ae..8dc16f4209 100644
--- a/tools/start-stop-daemon.c
+++ b/tools/start-stop-daemon.c
@@ -538,10 +538,7 @@ static void parse_options(int argc, char *const *argv)
execname = optarg;
break;
case 'c': /* --chuid <username>|<uid> */
- /* we copy the string just in case we need the
- * argument later. */
- changeuser = strdup(optarg);
- changeuser = strtok(changeuser, ":");
+ changeuser = strtok(optarg, ":");
changegroup = strtok(NULL, ":");
break;
case 'r': /* --chroot /new/root */
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 061c25cea5..92c6f64e1c 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -573,6 +573,7 @@ int vtysh_mark_file(const char *filename)
* appropriate */
if (strlen(vty_buf_trimmed) == 3
&& strncmp("end", vty_buf_trimmed, 3) == 0) {
+ cmd_free_strvec(vline);
continue;
}
@@ -804,8 +805,6 @@ static int vtysh_rl_describe(void)
} else if (rl_end && isspace((int)rl_line_buffer[rl_end - 1]))
vector_set(vline, NULL);
- describe = cmd_describe_command(vline, vty, &ret);
-
fprintf(stdout, "\n");
/* Ambiguous and no match error. */
@@ -824,6 +823,8 @@ static int vtysh_rl_describe(void)
break;
}
+ describe = cmd_describe_command(vline, vty, &ret);
+
/* Get width of command string. */
width = 0;
for (i = 0; i < vector_active(describe); i++)
diff --git a/zebra/rtadv.c b/zebra/rtadv.c
index 7f9bc47315..a1e1602bf8 100644
--- a/zebra/rtadv.c
+++ b/zebra/rtadv.c
@@ -675,6 +675,7 @@ static int rtadv_make_socket(void)
sizeof(struct icmp6_filter));
if (ret < 0) {
zlog_info("ICMP6_FILTER set fail: %s", safe_strerror(errno));
+ close(sock);
return ret;
}