summaryrefslogtreecommitdiff
path: root/pimd/pim_hello.c
diff options
context:
space:
mode:
Diffstat (limited to 'pimd/pim_hello.c')
-rw-r--r--pimd/pim_hello.c71
1 files changed, 42 insertions, 29 deletions
diff --git a/pimd/pim_hello.c b/pimd/pim_hello.c
index 3d7ae4ad22..0c08cfa46d 100644
--- a/pimd/pim_hello.c
+++ b/pimd/pim_hello.c
@@ -1,22 +1,21 @@
/*
- PIM for Quagga
- Copyright (C) 2008 Everton da Silva Marques
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; see the file COPYING; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- MA 02110-1301 USA
-*/
+ * PIM for Quagga
+ * Copyright (C) 2008 Everton da Silva Marques
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
#include <zebra.h>
@@ -428,15 +427,14 @@ int pim_hello_recv(struct interface *ifp,
return 0;
}
-int pim_hello_build_tlv(const char *ifname,
+int pim_hello_build_tlv(struct interface *ifp,
uint8_t *tlv_buf, int tlv_buf_size,
uint16_t holdtime,
uint32_t dr_priority,
uint32_t generation_id,
uint16_t propagation_delay,
uint16_t override_interval,
- int can_disable_join_suppression,
- struct list *ifconnected)
+ int can_disable_join_suppression)
{
uint8_t *curr = tlv_buf;
uint8_t *pastend = tlv_buf + tlv_buf_size;
@@ -454,7 +452,7 @@ int pim_hello_build_tlv(const char *ifname,
if (!curr) {
if (PIM_DEBUG_PIM_HELLO) {
zlog_debug("%s: could not set PIM hello Holdtime option for interface %s",
- __PRETTY_FUNCTION__, ifname);
+ __PRETTY_FUNCTION__, ifp->name);
}
return -1;
}
@@ -468,7 +466,7 @@ int pim_hello_build_tlv(const char *ifname,
if (!tmp) {
if (PIM_DEBUG_PIM_HELLO) {
zlog_debug("%s: could not set PIM LAN Prune Delay option for interface %s",
- __PRETTY_FUNCTION__, ifname);
+ __PRETTY_FUNCTION__, ifp->name);
}
return -1;
}
@@ -485,7 +483,7 @@ int pim_hello_build_tlv(const char *ifname,
if (!curr) {
if (PIM_DEBUG_PIM_HELLO) {
zlog_debug("%s: could not set PIM hello DR Priority option for interface %s",
- __PRETTY_FUNCTION__, ifname);
+ __PRETTY_FUNCTION__, ifp->name);
}
return -2;
}
@@ -498,23 +496,38 @@ int pim_hello_build_tlv(const char *ifname,
if (!curr) {
if (PIM_DEBUG_PIM_HELLO) {
zlog_debug("%s: could not set PIM hello Generation ID option for interface %s",
- __PRETTY_FUNCTION__, ifname);
+ __PRETTY_FUNCTION__, ifp->name);
}
return -3;
}
/* Secondary Address List */
- if (ifconnected) {
+ if (ifp->connected->count) {
curr = pim_tlv_append_addrlist_ucast(curr,
pastend,
- ifconnected);
+ ifp->connected,
+ AF_INET);
if (!curr) {
if (PIM_DEBUG_PIM_HELLO) {
- zlog_debug("%s: could not set PIM hello Secondary Address List option for interface %s",
- __PRETTY_FUNCTION__, ifname);
+ zlog_debug("%s: could not set PIM hello v4 Secondary Address List option for interface %s",
+ __PRETTY_FUNCTION__, ifp->name);
}
return -4;
}
+ if (pimg->send_v6_secondary)
+ {
+ curr = pim_tlv_append_addrlist_ucast(curr,
+ pastend,
+ ifp->connected,
+ AF_INET6);
+ if (!curr) {
+ if (PIM_DEBUG_PIM_HELLO) {
+ zlog_debug("%s: could not sent PIM hello v6 secondary Address List option for interface %s",
+ __PRETTY_FUNCTION__, ifp->name);
+ }
+ return -4;
+ }
+ }
}
return curr - tlv_buf;