summaryrefslogtreecommitdiffstats
path: root/isisd/isis_lsp.c
diff options
context:
space:
mode:
authorjardin <jardin>2003-12-23 09:56:18 +0100
committerjardin <jardin>2003-12-23 09:56:18 +0100
commit9e867fe663c4eb43c36f35067c0dd092e8c83c14 (patch)
treef29461b6a2dc8c38037dc0cf91e70392f9ed4ab2 /isisd/isis_lsp.c
parentInitial revision (diff)
downloadfrr-9e867fe663c4eb43c36f35067c0dd092e8c83c14.tar.xz
frr-9e867fe663c4eb43c36f35067c0dd092e8c83c14.zip
Merge isisd into the Quagga's framework:
- add privs support - use misc quagga's definitions - make it compile"able" - fix segfault cases related to hostname() - add debug isis xxx command This patch has been approved by Paul Jakma.
Diffstat (limited to 'isisd/isis_lsp.c')
-rw-r--r--isisd/isis_lsp.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c
index 6bfb0fd40..f797b9e64 100644
--- a/isisd/isis_lsp.c
+++ b/isisd/isis_lsp.c
@@ -60,7 +60,6 @@
extern struct isis *isis;
extern struct thread_master *master;
-extern struct host host;
int
lsp_id_cmp (u_char *id1, u_char *id2)
@@ -638,7 +637,7 @@ lspid_print (u_char *lsp_id, u_char *trg, char dynhost, char frag)
if (dyn)
sprintf (id, "%.14s", dyn->name.name);
else if (!memcmp (isis->sysid, lsp_id, ISIS_SYS_ID_LEN) & dynhost)
- sprintf (id, "%.14s", host.name);
+ sprintf (id, "%.14s", unix_hostname());
else {
memcpy(id, sysid_print (lsp_id), 15);
}
@@ -1053,8 +1052,9 @@ lsp_build_nonpseudo (struct isis_lsp *lsp, struct isis_area *area)
if (area->dynhostname) {
lsp->tlv_data.hostname = XMALLOC (MTYPE_ISIS_TLV,
sizeof (struct hostname));
- memcpy (&lsp->tlv_data.hostname->name, host.name, strlen(host.name));
- lsp->tlv_data.hostname->namelen = strlen (host.name);
+ memcpy (&lsp->tlv_data.hostname->name, unix_hostname(),
+ strlen(unix_hostname()));
+ lsp->tlv_data.hostname->namelen = strlen (unix_hostname());
}
#ifdef TOPOLOGY_GENERATE
/*
@@ -1337,8 +1337,10 @@ lsp_build_nonpseudo (struct isis_lsp *lsp, struct isis_area *area)
if (area->dynhostname) {
lsp->tlv_data.hostname = XMALLOC (MTYPE_ISIS_TLV,
sizeof (struct hostname));
- memcpy (lsp->tlv_data.hostname->name, host.name, strlen (host.name));
- lsp->tlv_data.hostname->namelen = strlen (host.name);
+
+ memcpy (lsp->tlv_data.hostname->name, unix_hostname(),
+ strlen (unix_hostname()));
+ lsp->tlv_data.hostname->namelen = strlen (unix_hostname());
}
/*
@@ -1553,13 +1555,14 @@ build_lsp_data (struct isis_lsp *lsp, struct isis_area *area)
if (area->dynhostname) {
tlv_ptr = lsppdu_realloc (lsp,MTYPE_ISIS_TLV, 2); /* the 2 is for the TL */
*tlv_ptr = DYNAMIC_HOSTNAME; /* Type */
- *(tlv_ptr+1) = strlen (host.name); /* Length */
+ *(tlv_ptr+1) = strlen (unix_hostname()); /* Length */
lsp->tlv_data.hostname = (struct hostname *)
(lsppdu_realloc(lsp,
MTYPE_ISIS_TLV,
/* the -1 is to fit the length in the struct */
- strlen (host.name)) - 1);
- memcpy (lsp->tlv_data.hostname->name, host.name, strlen(host.name));
+ strlen (unix_hostname())) - 1);
+ memcpy (lsp->tlv_data.hostname->name, unix_hostname(),
+ strlen(unix_hostname()));
}
}