--- /dev/null
+--- a/zebra/zserv.c
++++ b/zebra/zserv.c
+@@ -451,7 +451,7 @@ zsend_route_multipath (int cmd, struct zserv *client, struct prefix *p,
+ }
+
+ /* Metric */
+- if (cmd == ZEBRA_IPV4_ROUTE_ADD || ZEBRA_IPV6_ROUTE_ADD)
++ if (cmd == ZEBRA_IPV4_ROUTE_ADD || cmd == ZEBRA_IPV6_ROUTE_ADD)
+ {
+ SET_FLAG (zapi_flags, ZAPI_MESSAGE_DISTANCE);
+ stream_putc (s, rib->distance);
--- /dev/null
+--- a/lib/vty.c
++++ b/lib/vty.c
+@@ -250,7 +250,7 @@ vty_hello (struct vty *vty)
+ vty_out (vty, "MOTD file not found%s", VTY_NEWLINE);
+ }
+ else if (host.motd)
+- vty_out (vty, host.motd);
++ vty_out (vty, "%s", host.motd);
+ }
+
+ /* Put out prompt and wait input from user. */
--- /dev/null
+--- a/bgpd/bgp_packet.c
++++ b/bgpd/bgp_packet.c
+@@ -177,10 +177,11 @@ bgp_update_packet (struct peer *peer, afi_t afi, safi_t safi)
+
+ if (rn->prn)
+ prd = (struct prefix_rd *) &rn->prn->p;
+- if (binfo && binfo->extra)
++ if (binfo)
+ {
+- tag = binfo->extra->tag;
+ from = binfo->peer;
++ if (binfo->extra)
++ tag = binfo->extra->tag;
+ }
+
+ bgp_packet_set_marker (s, BGP_MSG_UPDATE);