summaryrefslogtreecommitdiff
path: root/zebra/main.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-08-06 07:35:50 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-08-08 11:14:05 +0200
commit689f5a8c84b95dbd31ecab481f8f2977965fe741 (patch)
tree7c2a2b69908b3c3ac60e0de41b5a3f85caec2ef5 /zebra/main.c
parent00857b241e6c27efad54a19b4226c37f04d80bf5 (diff)
*: remove --enable-tcp-zebra, rework ZAPI path
This adds "@tcp" as new choice on the -z option present in zebra and the protocol daemons. The --enable-tcp-zebra option on configure is no longer needed, both UNIX and TCP socket support is always available. Note that @tcp should not be used by default (e.g. in an init script), and --enable-tcp-zebra should never have been in any distro package builds, because **** TCP-ZEBRA IS A SECURITY PROBLEM **** It allows arbitrary local users to mess with the routing table and inject bogus data -- and also ZAPI is not designed to be robust against attacks. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'zebra/main.c')
-rw-r--r--zebra/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/zebra/main.c b/zebra/main.c
index 27a6f3e027..ddd6db5254 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -204,6 +204,8 @@ int main(int argc, char **argv)
char *zserv_path = NULL;
/* Socket to external label manager */
char *lblmgr_path = NULL;
+ struct sockaddr_storage dummy;
+ socklen_t dummylen;
frr_preinit(&zebra_di, argc, argv);
@@ -256,6 +258,12 @@ int main(int argc, char **argv)
break;
case 'z':
zserv_path = optarg;
+ if (!frr_zclient_addr(&dummy, &dummylen, optarg)) {
+ fprintf(stderr,
+ "Invalid zserv socket path: %s\n",
+ optarg);
+ exit(1);
+ }
break;
case 'l':
lblmgr_path = optarg;