From 69bf3a39931ce61a92fb04d8888b4655fd5620a2 Mon Sep 17 00:00:00 2001 From: Dmitrij Tejblum Date: Thu, 18 Aug 2011 20:22:17 +0400 Subject: lib: simplify interface of setsockopt_multicast_ipv4(). * sockopt.[ch] (setsockopt_ipv4_multicast): ifindex is now mandatory (all non-ancient OSes can use it anyway), and if_addr parameter (the address of the interface) is now gone. (setsockopt_ipv4_multicast_if): IP_MULTICAST_IF processing moved to this new function * ospf_network.c (ospf_if_add_allspfrouters, ospf_if_drop_allspfrouters, ospf_if_add_alldrouters, ospf_if_drop_alldrouters, ospf_if_ipmulticast), rip_interface.c (ipv4_multicast_join, ipv4_multicast_leave, rip_interface_new): adapt to the new interface --- ripd/rip_interface.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'ripd') diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index d3b55fc0..810b71c0 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -78,9 +78,8 @@ ipv4_multicast_join (int sock, { int ret; - ret = setsockopt_multicast_ipv4 (sock, + ret = setsockopt_ipv4_multicast (sock, IP_ADD_MEMBERSHIP, - ifa, group.s_addr, ifindex); @@ -100,9 +99,8 @@ ipv4_multicast_leave (int sock, { int ret; - ret = setsockopt_multicast_ipv4 (sock, + ret = setsockopt_ipv4_multicast (sock, IP_DROP_MEMBERSHIP, - ifa, group.s_addr, ifindex); @@ -138,18 +136,13 @@ rip_interface_new (void) void rip_interface_multicast_set (int sock, struct connected *connected) { - struct in_addr addr; - assert (connected != NULL); - addr = CONNECTED_ID(connected)->u.prefix4; - - if (setsockopt_multicast_ipv4 (sock, IP_MULTICAST_IF, addr, 0, - connected->ifp->ifindex) < 0) + if (setsockopt_ipv4_multicast_if (sock, connected->ifp->ifindex) < 0) { zlog_warn ("Can't setsockopt IP_MULTICAST_IF on fd %d to " - "source address %s for interface %s", - sock, inet_ntoa(addr), + "ifindex %d for interface %s", + sock, connected->ifp->ifindex, connected->ifp->name); } -- cgit v1.2.1 From b51146856e660bcec723f535c17dc1c38b2f6efc Mon Sep 17 00:00:00 2001 From: Vyacheslav Trushkin Date: Fri, 25 Nov 2011 18:51:48 +0400 Subject: quagga: option "-z" ("--socket ") added All daemons modified to support custom path to zserv socket. lib: generalize a zclient connection zclient_socket_connect added. zclient_socket and zclient_socket_un were hidden under static expression. "zclient_serv_path_set" modified. --- ripd/rip_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ripd') diff --git a/ripd/rip_main.c b/ripd/rip_main.c index 57b5f3af..ccb5fa01 100644 --- a/ripd/rip_main.c +++ b/ripd/rip_main.c @@ -32,6 +32,7 @@ #include "log.h" #include "privs.h" #include "sigevent.h" +#include "zclient.h" #include "ripd/ripd.h" @@ -41,6 +42,7 @@ static struct option longopts[] = { "daemon", no_argument, NULL, 'd'}, { "config_file", required_argument, NULL, 'f'}, { "pid_file", required_argument, NULL, 'i'}, + { "socket", required_argument, NULL, 'z'}, { "help", no_argument, NULL, 'h'}, { "dryrun", no_argument, NULL, 'C'}, { "vty_addr", required_argument, NULL, 'A'}, @@ -109,6 +111,7 @@ Daemon which manages RIP version 1 and 2.\n\n\ -d, --daemon Runs in daemon mode\n\ -f, --config_file Set configuration file name\n\ -i, --pid_file Set process identifier file name\n\ +-z, --socket Set path of zebra socket\n\ -A, --vty_addr Set vty's bind address\n\ -P, --vty_port Set vty's port number\n\ -C, --dryrun Check configuration for validity and exit\n\ @@ -206,7 +209,7 @@ main (int argc, char **argv) { int opt; - opt = getopt_long (argc, argv, "df:i:hA:P:u:g:rvC", longopts, 0); + opt = getopt_long (argc, argv, "df:i:z:hA:P:u:g:rvC", longopts, 0); if (opt == EOF) break; @@ -227,6 +230,9 @@ main (int argc, char **argv) case 'i': pid_file = optarg; break; + case 'z': + zclient_serv_path_set (optarg); + break; case 'P': /* Deal with atoi() returning 0 on failure, and ripd not listening on rip port... */ -- cgit v1.2.1 From 05e54ee3df973194f2a00e3ea0b1da7bebc71fd6 Mon Sep 17 00:00:00 2001 From: Denis Ovsienko Date: Sat, 3 Dec 2011 17:45:17 +0400 Subject: build: delete .cvsignore files --- ripd/.cvsignore | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 ripd/.cvsignore (limited to 'ripd') diff --git a/ripd/.cvsignore b/ripd/.cvsignore deleted file mode 100644 index 41fd8c82..00000000 --- a/ripd/.cvsignore +++ /dev/null @@ -1,14 +0,0 @@ -Makefile -Makefile.in -*.o -ripd -ripd.conf -tags -TAGS -.deps -.nfs* -*.lo -*.la -*.libs -.arch-inventory -.arch-ids -- cgit v1.2.1 From b4e45f67057be22133b6bec88cdf285d5c8214db Mon Sep 17 00:00:00 2001 From: Denis Ovsienko Date: Mon, 5 Dec 2011 16:35:14 +0400 Subject: fix zebra protocol after MP-BGP changes The previous commits modified both zebra and bgpd for additional SAFI field, but not any other routing daemon, which led to zebra daemon crashing with failed assertion. --- ripd/rip_zebra.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ripd') diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c index c476d8f4..1d10b103 100644 --- a/ripd/rip_zebra.c +++ b/ripd/rip_zebra.c @@ -46,6 +46,7 @@ rip_zebra_ipv4_add (struct prefix_ipv4 *p, struct in_addr *nexthop, api.type = ZEBRA_ROUTE_RIP; api.flags = 0; api.message = 0; + api.safi = SAFI_UNICAST; SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP); api.nexthop_num = 1; api.nexthop = &nexthop; @@ -76,6 +77,7 @@ rip_zebra_ipv4_delete (struct prefix_ipv4 *p, struct in_addr *nexthop, api.type = ZEBRA_ROUTE_RIP; api.flags = 0; api.message = 0; + api.safi = SAFI_UNICAST; SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP); api.nexthop_num = 1; api.nexthop = &nexthop; -- cgit v1.2.1 From 9c58fbd7d7658055c2b3074489c6d338448d88e9 Mon Sep 17 00:00:00 2001 From: Matthieu Boutier Date: Thu, 9 Feb 2012 21:51:17 +0100 Subject: ripd: add babel for redistribution. --- ripd/rip_zebra.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ripd') diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c index 1d10b103..199e85e8 100644 --- a/ripd/rip_zebra.c +++ b/ripd/rip_zebra.c @@ -207,7 +207,8 @@ static struct { {ZEBRA_ROUTE_CONNECT, 1, "connected"}, {ZEBRA_ROUTE_STATIC, 1, "static"}, {ZEBRA_ROUTE_OSPF, 1, "ospf"}, - {ZEBRA_ROUTE_BGP, 1, "bgp"}, + {ZEBRA_ROUTE_BGP, 2, "bgp"}, + {ZEBRA_ROUTE_BABEL, 2, "babel"}, {0, 0, NULL} }; -- cgit v1.2.1