summaryrefslogtreecommitdiff
path: root/ldpd/packet.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2016-12-12 18:35:30 -0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-12-14 13:21:08 -0500
commit4913a1680eb922f6747b9ebfec18848f51a71bac (patch)
tree7e8f7e762b438c7de1d529f6e5e70da38ccffc22 /ldpd/packet.c
parente5dd4bef5eeeac880ba97480b76d46f32726985a (diff)
ldpd: add missing check on disc_find_iface()
When we find an interface on disc_find_iface(), we need to check if it's enabled for the address-family (IPv4 or IPv6) of the received packet. We were doing that only for targeted hellos, do it for link hellos as well. Signed-off-by: Renato Westphal <renato@opensourcerouting.org> (cherry picked from commit 6710e336b3afd913c5b15677159e8274680ea8cb)
Diffstat (limited to 'ldpd/packet.c')
-rw-r--r--ldpd/packet.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ldpd/packet.c b/ldpd/packet.c
index 9b3151d720..ad78181311 100644
--- a/ldpd/packet.c
+++ b/ldpd/packet.c
@@ -292,16 +292,16 @@ disc_find_iface(unsigned int ifindex, int af, union ldpd_addr *src,
if (iface == NULL)
return (NULL);
+ ia = iface_af_get(iface, af);
+ if (!ia->enabled)
+ return (NULL);
+
/*
* For unicast packets, we just need to make sure that the interface
* is enabled for the given address-family.
*/
- if (!multicast) {
- ia = iface_af_get(iface, af);
- if (ia->enabled)
- return (iface);
- return (NULL);
- }
+ if (!multicast)
+ return (iface);
switch (af) {
case AF_INET: