From 75f1349106337324be2bac244b699189e9312e2f Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 15 Apr 2016 13:09:58 -0400 Subject: [PATCH 1/3] quagga: Check for existence of IFLA_INFO_SLAVE_KIND IFLA_INFO_SLAVE_KIND is a new type of netlink message If the kernel makes it available compile in support else we'll just silently do the right thing. Additionally reduce the test cases for netlink by 1 Signed-off-by: Donald Sharp Reviewed-by: David Ahern Reviewed-by: Don Slice Reviewed-by: Vivek Venkatraman --- configure.ac | 8 ++------ zebra/rt_netlink.c | 4 ++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 718bd2d03c..5257b411d3 100755 --- a/configure.ac +++ b/configure.ac @@ -837,12 +837,7 @@ dnl Determine routing get and set method dnl ------------------------------------ AC_MSG_CHECKING(zebra between kernel interface method) if test x"$opsys" = x"gnu-linux"; then - if test "${enable_netlink}" = "yes";then - AC_MSG_RESULT(netlink) - RT_METHOD=rt_netlink.o - AC_DEFINE(HAVE_NETLINK,,netlink) - netlink=yes - elif test "${enable_netlink}" = "no"; then + if test "${enable_netlink}" = "no"; then AC_MSG_RESULT(ioctl) RT_METHOD=rt_ioctl.o netlink=no @@ -851,6 +846,7 @@ if test x"$opsys" = x"gnu-linux"; then RT_METHOD=rt_netlink.o AC_DEFINE(HAVE_NETLINK,,netlink) netlink=yes + AC_CHECK_DECLS([IFLA_INFO_SLAVE_KIND], [], [], [#include ]) fi elif test x"$opsys" = x"sol2-6";then AC_MSG_RESULT(Route socket) diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 78364f6f4a..8fb75640e8 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -654,8 +654,10 @@ netlink_interface (struct sockaddr_nl *snl, struct nlmsghdr *h, if (linkinfo[IFLA_INFO_KIND]) kind = RTA_DATA(linkinfo[IFLA_INFO_KIND]); +#if HAVE_DECL_IFLA_INFO_SLAVE_KIND if (linkinfo[IFLA_INFO_SLAVE_KIND]) slave_kind = RTA_DATA(linkinfo[IFLA_INFO_SLAVE_KIND]); +#endif if (kind && strcmp(kind, "vrf") == 0) { @@ -1304,8 +1306,10 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h, if (linkinfo[IFLA_INFO_KIND]) kind = RTA_DATA(linkinfo[IFLA_INFO_KIND]); +#if HAVE_DECL_IFLA_INFO_SLAVE_KIND if (linkinfo[IFLA_INFO_SLAVE_KIND]) slave_kind = RTA_DATA(linkinfo[IFLA_INFO_SLAVE_KIND]); +#endif if (kind && strcmp(kind, "vrf") == 0) { From 279c6956d90fd4ba8aa0ff60b9a0484b9933f827 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 15 Apr 2016 09:15:21 -0400 Subject: [PATCH 2/3] vtysh: Allow file read in to continue in more cases When a duplicate command is read in from a file, there are cases where daemons return CMD_WARNING this causes the command to not be send to subsuquent daemons( if any ). Allow the read in of commands to continue in this situation. Ticket: CM-10393 Signed-off-by: Donald Sharp Reviewed-by: Don Slice --- vtysh/vtysh.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index f7f38049eb..44d67e8f9d 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -723,7 +723,15 @@ vtysh_config_from_file (struct vty *vty, FILE *fp) { cmd_stat = vtysh_client_execute (&vtysh_client[i], vty->buf, stdout); - if (cmd_stat != CMD_SUCCESS) + /* + * CMD_WARNING - Can mean that the command was + * parsed successfully but it was already entered + * in a few spots. As such if we receive a + * CMD_WARNING from a daemon we shouldn't stop + * talking to the other daemons for the particular + * command. + */ + if (cmd_stat != CMD_SUCCESS && cmd_stat != CMD_WARNING) { fprintf (stderr, "line %d: Failure to communicate[%d] to %s, line: %s\n", lineno, cmd_stat, vtysh_client[i].name, vty->buf); From 317c1004ee4efd1ebdc52a401cbe3d85dba8cad1 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 15 Apr 2016 10:04:30 -0400 Subject: [PATCH 3/3] debian: Remove /usr/bin/quagga from distribution We've decided to remove /usr/bin/quagga from the quagga packaging. It was only going to confuse the end user. Ticket: CM-10456 Signed-off-by: Donald Sharp Reviewed-by: Don Slice --- debian/bgpd.service | 1 - debian/isisd.service | 1 - debian/ospf6d.service | 1 - debian/ospfd.service | 1 - debian/ospfd@.service | 1 - debian/quagga.install | 1 - debian/ripd.service | 1 - debian/ripngd.service | 1 - debian/zebra.service | 1 - 9 files changed, 9 deletions(-) diff --git a/debian/bgpd.service b/debian/bgpd.service index 6fb9560d68..5475dd7013 100644 --- a/debian/bgpd.service +++ b/debian/bgpd.service @@ -17,7 +17,6 @@ Restart=on-abnormal LimitNOFILE=1024 ExecStart=/usr/lib/quagga/bgpd $BGPD_OPTIONS ExecStartPost=/usr/bin/vtysh -b -n -ExecStopPost=-/usr/bin/touch /var/run/quagga/bgpd.was_running ExecStopPost=-/bin/rm -f /var/run/quagga/bgpd.pid ExecStopPost=-/bin/rm -f /var/run/quagga/bgpd.vty ExecReload=/usr/lib/quagga/quagga-reload.py --reload /etc/quagga/Quagga.conf diff --git a/debian/isisd.service b/debian/isisd.service index 444d60f5f4..04404fc266 100644 --- a/debian/isisd.service +++ b/debian/isisd.service @@ -17,7 +17,6 @@ Restart=on-abnormal LimitNOFILE=1024 ExecStart=/usr/lib/quagga/isisd $ISISD_OPTIONS ExecStartPost=/usr/bin/vtysh -b -n -ExecStopPost=-/bin/touch /var/run/quagga/isisd.was_running ExecStopPost=-/bin/rm -f /var/run/quagga/isisd.pid ExecStopPost=-/bin/rm -f /var/run/quagga/isisd.vty ExecReload=/usr/lib/quagga/quagga-reload.py --reload /etc/quagga/Quagga.conf diff --git a/debian/ospf6d.service b/debian/ospf6d.service index 890fd0d837..3c5b8a050c 100644 --- a/debian/ospf6d.service +++ b/debian/ospf6d.service @@ -16,7 +16,6 @@ RestartSec=5 Restart=on-abnormal ExecStart=/usr/lib/quagga/ospf6d $OSPF6D_OPTIONS ExecStartPost=/usr/bin/vtysh -b -n -ExecStopPost=-/usr/bin/touch /var/run/quagga/ospf6d.was_running ExecStopPost=-/bin/rm -f /var/run/quagga/ospf6d.pid ExecStopPost=-/bin/rm -f /var/run/quagga/ospf6d.vty ExecReload=/usr/lib/quagga/quagga-reload.py --reload /etc/quagga/Quagga.conf diff --git a/debian/ospfd.service b/debian/ospfd.service index e83cebe3c1..157d05b07b 100644 --- a/debian/ospfd.service +++ b/debian/ospfd.service @@ -17,7 +17,6 @@ Restart=on-abnormal LimitNOFILE=1024 ExecStart=/usr/lib/quagga/ospfd $OSPFD_OPTIONS ExecStartPost=/usr/bin/vtysh -b -n -ExecStopPost=-/usr/bin/touch /var/run/quagga/ospfd.was_running ExecStopPost=-/bin/rm -f /var/run/quagga/ospfd.pid ExecStopPost=-/bin/rm -f /var/run/quagga/ospfd.vty ExecReload=/usr/lib/quagga/quagga-reload.py --reload /etc/quagga/Quagga.conf diff --git a/debian/ospfd@.service b/debian/ospfd@.service index 1b25e0f4b2..f23e83a06c 100644 --- a/debian/ospfd@.service +++ b/debian/ospfd@.service @@ -17,7 +17,6 @@ Restart=on-abnormal LimitNOFILE=1024 ExecStart=/usr/lib/quagga/ospfd $OSPFD_OPTIONS -n %I ExecStartPost=/usr/bin/vtysh -b -n -ExecStopPost=-/bin/touch /var/run/quagga/ospfd@%I.was_running ExecStopPost=-/bin/rm -f /var/run/quagga/ospfd@%I.pid ExecStopPost=-/bin/rm -f /var/run/quagga/ospfd@%I.vty ExecReload=/usr/lib/quagga/quagga-reload.py --reload /etc/quagga/Quagga.conf diff --git a/debian/quagga.install b/debian/quagga.install index 38f6a770f5..cbec92ca64 100644 --- a/debian/quagga.install +++ b/debian/quagga.install @@ -3,7 +3,6 @@ usr/bin/vtysh usr/include/quagga/ usr/lib/ tools/quagga-reload.py usr/lib/quagga/ -tools/quagga usr/bin usr/share/doc/quagga/ usr/share/man/man1/vtysh.1 usr/share/man/man1/quagga.1 diff --git a/debian/ripd.service b/debian/ripd.service index f70a316f51..f9c904df30 100644 --- a/debian/ripd.service +++ b/debian/ripd.service @@ -17,7 +17,6 @@ Restart=on-abnormal LimitNOFILE=1024 ExecStart=/usr/lib/quagga/ripd $RIPD_OPTIONS ExecStartPost=/usr/bin/vtysh -b -n -ExecStopPost=-/usr/bin/touch /var/run/quagga/ripd.was_running ExecStopPost=-/bin/rm -f /var/run/quagga/ripd.pid ExecStopPost=-/bin/rm -f /var/run/quagga/ripd.vty ExecReload=/usr/lib/quagga/quagga-reload.py --reload /etc/quagga/Quagga.conf diff --git a/debian/ripngd.service b/debian/ripngd.service index 48878a645c..448a7999a5 100644 --- a/debian/ripngd.service +++ b/debian/ripngd.service @@ -17,7 +17,6 @@ Restart=on-abnormal LimitNOFILE=1024 ExecStart=/usr/lib/quagga/ripngd $RIPNGD_OPTIONS ExecStartPost=/usr/bin/vtysh -b -n -ExecStopPost=-/bin/touch /var/run/quagga/ripngd.was_running ExecStopPost=-/bin/rm -f /var/run/quagga/ripngd.pid ExecStopPost=-/bin/rm -f /var/run/quagga/ripngd.vty ExecReload=/usr/lib/quagga/quagga-reload.py --reload /etc/quagga/Quagga.conf diff --git a/debian/zebra.service b/debian/zebra.service index 42b1d81fab..9d8634c30d 100644 --- a/debian/zebra.service +++ b/debian/zebra.service @@ -16,7 +16,6 @@ Restart=on-abnormal LimitNOFILE=1024 ExecStart=/usr/lib/quagga/zebra $ZEBRA_OPTIONS ExecStartPost=/usr/bin/vtysh -b -n -ExecStopPost=-/usr/bin/touch /var/run/quagga/zebra.was_running ExecStopPost=-/bin/rm -f /var/run/quagga/zebra.pid ExecStopPost=-/bin/rm -f /var/run/quagga/zebra.vty ExecReload=/usr/lib/quagga/quagga-reload.py --reload /etc/quagga/Quagga.conf