diff options
author | 2016-05-23 16:31:27 +0000 | |
---|---|---|
committer | 2016-05-23 16:31:27 +0000 | |
commit | b043c9d1ab717d45ccac35152a24051bc3522b1c (patch) | |
tree | 646afa4f5ea5250bb1a593754d222482107beb48 | |
parent | Fix byte order issues with notification messages. (diff) | |
download | wireguard-openbsd-b043c9d1ab717d45ccac35152a24051bc3522b1c.tar.xz wireguard-openbsd-b043c9d1ab717d45ccac35152a24051bc3522b1c.zip |
Remove unnecessary mirroring of sockets.
-rw-r--r-- | usr.sbin/ldpd/adjacency.c | 3 | ||||
-rw-r--r-- | usr.sbin/ldpd/hello.c | 6 | ||||
-rw-r--r-- | usr.sbin/ldpd/interface.c | 4 | ||||
-rw-r--r-- | usr.sbin/ldpd/ldpd.h | 4 |
4 files changed, 8 insertions, 9 deletions
diff --git a/usr.sbin/ldpd/adjacency.c b/usr.sbin/ldpd/adjacency.c index 263940be94a..44ee07f5f4e 100644 --- a/usr.sbin/ldpd/adjacency.c +++ b/usr.sbin/ldpd/adjacency.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adjacency.c,v 1.12 2016/05/23 16:27:16 renato Exp $ */ +/* $OpenBSD: adjacency.c,v 1.13 2016/05/23 16:31:27 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -227,6 +227,7 @@ tnbr_hello_timer(int fd, short event, void *arg) { struct tnbr *tnbr = arg; + tnbr->discovery_fd = global.ldp_edisc_socket; send_hello(HELLO_TARGETED, NULL, tnbr); tnbr_start_hello_timer(tnbr); } diff --git a/usr.sbin/ldpd/hello.c b/usr.sbin/ldpd/hello.c index 5f1fabcb611..4d362839e54 100644 --- a/usr.sbin/ldpd/hello.c +++ b/usr.sbin/ldpd/hello.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hello.c,v 1.35 2016/05/23 16:20:59 renato Exp $ */ +/* $OpenBSD: hello.c,v 1.36 2016/05/23 16:31:27 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -60,7 +60,7 @@ send_hello(enum hello_type type, struct iface *iface, struct tnbr *tnbr) inet_aton(AllRouters, &dst.sin_addr); holdtime = iface->hello_holdtime; flags = 0; - fd = iface->discovery_fd; + fd = global.ldp_disc_socket; break; case HELLO_TARGETED: dst.sin_addr.s_addr = tnbr->addr.s_addr; @@ -68,7 +68,7 @@ send_hello(enum hello_type type, struct iface *iface, struct tnbr *tnbr) flags = TARGETED_HELLO; if ((tnbr->flags & F_TNBR_CONFIGURED) || tnbr->pw_count) flags |= REQUEST_TARG_HELLO; - fd = tnbr->discovery_fd; + fd = global.ldp_edisc_socket; break; } diff --git a/usr.sbin/ldpd/interface.c b/usr.sbin/ldpd/interface.c index 19aec9a6541..d0577a7de8b 100644 --- a/usr.sbin/ldpd/interface.c +++ b/usr.sbin/ldpd/interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interface.c,v 1.33 2016/05/23 16:27:16 renato Exp $ */ +/* $OpenBSD: interface.c,v 1.34 2016/05/23 16:31:27 renato Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -485,7 +485,7 @@ if_set_mcast(struct iface *iface) if_addr = LIST_FIRST(&iface->addr_list); - if (setsockopt(iface->discovery_fd, IPPROTO_IP, IP_MULTICAST_IF, + if (setsockopt(global.ldp_disc_socket, IPPROTO_IP, IP_MULTICAST_IF, &if_addr->addr.s_addr, sizeof(if_addr->addr.s_addr)) < 0) { log_debug("%s: error setting IP_MULTICAST_IF, interface %s", __func__, iface->name); diff --git a/usr.sbin/ldpd/ldpd.h b/usr.sbin/ldpd/ldpd.h index 24307999a29..a3880577f91 100644 --- a/usr.sbin/ldpd/ldpd.h +++ b/usr.sbin/ldpd/ldpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ldpd.h,v 1.60 2016/05/23 16:14:36 renato Exp $ */ +/* $OpenBSD: ldpd.h,v 1.61 2016/05/23 16:31:27 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -223,7 +223,6 @@ struct iface { time_t uptime; unsigned int ifindex; - int discovery_fd; int state; u_int16_t hello_holdtime; u_int16_t hello_interval; @@ -237,7 +236,6 @@ struct iface { struct tnbr { LIST_ENTRY(tnbr) entry; struct event hello_timer; - int discovery_fd; struct adj *adj; struct in_addr addr; |