]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/xref.c
*: auto-convert to SPDX License IDs
[mirror_frr.git] / lib / xref.c
index 40efe51363143f2bc3f93a2b599bb5e1f872744a..fc0ba6298f545e335ae26d736c0887a01c6f9ec0 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2017-20  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -35,6 +24,8 @@
 struct xref_block *xref_blocks;
 static struct xref_block **xref_block_last = &xref_blocks;
 
+struct xrefdata_uid_head xrefdata_uid = INIT_RBTREE_UNIQ(xrefdata_uid);
+
 static void base32(uint8_t **inpos, int *bitpos,
                   char *out, size_t n_chars)
 {
@@ -93,8 +84,6 @@ static void xref_add_one(const struct xref *xref)
                q = memrchr(filename, '/', p - filename);
                if (q)
                        filename = q + 1;
-               else
-                       filename = p + 1;
        }
 
        SHA256_Init(&sha);
@@ -111,6 +100,8 @@ static void xref_add_one(const struct xref *xref)
        base32(&h, &bitpos, &xrefdata->uid[0], 5);
        xrefdata->uid[5] = '-';
        base32(&h, &bitpos, &xrefdata->uid[6], 5);
+
+       xrefdata_uid_add(&xrefdata_uid, xrefdata);
 }
 
 void xref_gcc_workaround(const struct xref *xref)