summaryrefslogtreecommitdiffstats
path: root/isisd/isis_lsp.c
diff options
context:
space:
mode:
authorhasso <hasso>2004-10-03 20:18:34 +0200
committerhasso <hasso>2004-10-03 20:18:34 +0200
commit18a6dce6f83dd20caf1f36c8e840868ff0bf6dbd (patch)
treeff832cbf6fe2b239bde06268820587bec671ae6d /isisd/isis_lsp.c
parent2004-09-30 Paul Jakma <paul@dishone.st> (diff)
downloadfrr-18a6dce6f83dd20caf1f36c8e840868ff0bf6dbd.tar.xz
frr-18a6dce6f83dd20caf1f36c8e840868ff0bf6dbd.zip
Common router id.
Diffstat (limited to 'isisd/isis_lsp.c')
-rw-r--r--isisd/isis_lsp.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c
index 2f1854374..567afa3b5 100644
--- a/isisd/isis_lsp.c
+++ b/isisd/isis_lsp.c
@@ -59,6 +59,7 @@
extern struct isis *isis;
extern struct thread_master *master;
+extern struct in_addr router_id_zebra;
/* staticly assigned vars for printing purposes */
char lsp_bits_string[200]; /* FIXME: enough ? */
@@ -1380,6 +1381,7 @@ lsp_build_nonpseudo (struct isis_lsp *lsp, struct isis_area *area)
struct tlvs tlv_data;
struct isis_lsp *lsp0 = lsp;
struct isis_passwd *passwd;
+ struct in_addr *routerid;
/*
* First add the tlvs related to area
@@ -1446,6 +1448,30 @@ lsp_build_nonpseudo (struct isis_lsp *lsp, struct isis_area *area)
memset (&tlv_data, 0, sizeof (struct tlvs));
/*
+ * IPv4 address TLV. We don't follow "C" vendor, but "J" vendor behavior -
+ * one IPv4 address is put into LSP and this address is same as router id.
+ */
+ if (router_id_zebra.s_addr != 0)
+ {
+ u_char value[4];
+
+ if (lsp->tlv_data.ipv4_addrs == NULL)
+ lsp->tlv_data.ipv4_addrs = list_new ();
+
+ routerid = XMALLOC (MTYPE_ISIS_TLV, sizeof (struct in_addr));
+ routerid->s_addr = router_id_zebra.s_addr;
+
+ listnode_add (lsp->tlv_data.ipv4_addrs, routerid);
+
+ /*
+ * FIXME: Using add_tlv() directly is hack, but tlv_add_ip_addrs()
+ * expects list of prefix_ipv4 structures, but we have list of
+ * in_addr structures.
+ */
+ add_tlv (IPV4_ADDR, IPV4_MAX_BYTELEN, (u_char *) &routerid->s_addr,
+ lsp->pdu);
+ }
+ /*
* Then build lists of tlvs related to circuits
*/
for (node = listhead (area->circuit_list); node; nextnode (node))