summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorRenato Westphal <renato@cvs.openbsd.org>2016-06-13 20:15:59 +0000
committerRenato Westphal <renato@cvs.openbsd.org>2016-06-13 20:15:59 +0000
commit8d0c21ec0c22a79077078afaab1297007e6c19bf (patch)
tree61036a9929f0aba0402af61f8dab8ad730fae68a /usr.sbin
parent8d8633aa6bc2053bcbddc0c70783680c73cad8b3 (diff)
Do not create sockets for disabled address-families.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ldpd/ldpd.c8
-rw-r--r--usr.sbin/ldpd/ldpe.c8
2 files changed, 10 insertions, 6 deletions
diff --git a/usr.sbin/ldpd/ldpd.c b/usr.sbin/ldpd/ldpd.c
index fa18779a515..faf128bdae0 100644
--- a/usr.sbin/ldpd/ldpd.c
+++ b/usr.sbin/ldpd/ldpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpd.c,v 1.51 2016/06/08 23:30:07 renato Exp $ */
+/* $OpenBSD: ldpd.c,v 1.52 2016/06/13 20:15:58 renato Exp $ */
/*
* Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
@@ -272,8 +272,10 @@ main(int argc, char *argv[])
if (kr_init(!(ldpd_conf->flags & F_LDPD_NO_FIB_UPDATE)) == -1)
fatalx("kr_init failed");
- main_imsg_send_net_sockets(AF_INET);
- main_imsg_send_net_sockets(AF_INET6);
+ if (ldpd_conf->ipv4.flags & F_LDPD_AF_ENABLED)
+ main_imsg_send_net_sockets(AF_INET);
+ if (ldpd_conf->ipv6.flags & F_LDPD_AF_ENABLED)
+ main_imsg_send_net_sockets(AF_INET6);
/* remove unneded stuff from config */
/* ... */
diff --git a/usr.sbin/ldpd/ldpe.c b/usr.sbin/ldpd/ldpe.c
index d29f2676886..50b051d277f 100644
--- a/usr.sbin/ldpd/ldpe.c
+++ b/usr.sbin/ldpd/ldpe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpe.c,v 1.64 2016/06/09 17:26:32 renato Exp $ */
+/* $OpenBSD: ldpe.c,v 1.65 2016/06/13 20:15:58 renato Exp $ */
/*
* Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
@@ -319,8 +319,10 @@ ldpe_dispatch_main(int fd, short event, void *bula)
disc_socket = -1;
edisc_socket = -1;
session_socket = -1;
- ldpe_imsg_compose_parent(IMSG_REQUEST_SOCKETS, af,
- NULL, 0);
+ if ((ldp_af_conf_get(leconf, af))->flags &
+ F_LDPD_AF_ENABLED)
+ ldpe_imsg_compose_parent(IMSG_REQUEST_SOCKETS,
+ af, NULL, 0);
break;
case IMSG_SOCKET_NET:
if (imsg.hdr.len != IMSG_HEADER_SIZE +