]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_rd.c
Merge pull request #2372 from gromit1811/pim-comment-fix
[mirror_frr.git] / bgpd / bgp_rd.c
index 64e083d1ef25b9f7c9dc5284567200e33fd26e68..356a949d691c0a79b3e08907536e1072cef917d3 100644 (file)
@@ -200,3 +200,15 @@ char *prefix_rd2str(struct prefix_rd *prd, char *buf, size_t size)
        snprintf(buf, size, "Unknown Type: %d", type);
        return buf;
 }
+
+void form_auto_rd(struct in_addr router_id,
+                 uint16_t rd_id,
+                 struct prefix_rd *prd)
+{
+       char buf[100];
+
+       prd->family = AF_UNSPEC;
+       prd->prefixlen = 64;
+       sprintf(buf, "%s:%hu", inet_ntoa(router_id), rd_id);
+       (void)str2prefix_rd(buf, prd);
+}