]> git.proxmox.com Git - mirror_frr.git/commitdiff
pimd: temporarily disable IPv6 types
authorDavid Lamparter <equinox@opensourcerouting.org>
Mon, 10 Jan 2022 08:40:50 +0000 (09:40 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Wed, 12 Jan 2022 17:24:07 +0000 (18:24 +0100)
Just putting the infrastructure in place and having it disabled is
actually good progress here;  have the compiler make itself useful and
tell us what we have to do to get the basics right.

(The next commit will cause a *lot* of compile errors as soon as
`PIM_V6_TEMP_BREAK` is set; but there is no reason to force everything
into a single step here.)

To enable `pim_addr = in6_addr`, run `make PIM_V6_TEMP_BREAK=1` (remove
previous compile results with `rm pimd/pim6d-*.o`)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
pimd/pim_addr.c
pimd/pim_addr.h
pimd/subdir.am

index bc9beca4ef6f61418068c298680162ff24a0d4e3..825f38274a81bb465de32830ca952117b248ccd5 100644 (file)
@@ -48,6 +48,9 @@ static ssize_t printfrr_pimaddr(struct fbuf *buf, struct printfrr_eargs *ea,
 
 #if PIM_IPV == 4
        return bprintfrr(buf, "%pI4", addr);
+#elif !defined(PIM_V6_TEMP_BREAK)
+       CPP_NOTICE("note IPv6 typing for pim_addr is temporarily disabled.");
+       return bprintfrr(buf, "%pI4", addr);
 #else
        return bprintfrr(buf, "%pI6", addr);
 #endif
index 1e9da77779bec39644cf162114e3155ef245a9db..a1a8b55a5c89c00320178d8021518213f736bd95 100644 (file)
 
 #include "jhash.h"
 
-#if PIM_IPV == 4
+/* temporarily disable IPv6 types to keep code compiling.
+ * Defining PIM_V6_TEMP_BREAK will show a lot of compile errors - they are
+ * very useful to see TODOs.
+ */
+#if PIM_IPV == 4 || !defined(PIM_V6_TEMP_BREAK)
 typedef struct in_addr pim_addr;
 #define PIM_ADDRSTRLEN INET_ADDRSTRLEN
 #else
index 355389ed74ad4127cf28c0a4b49b2cd04a8346ca..ff20164c06018e5ddde9d52b3515fc69c30ebe5d 100644 (file)
@@ -158,7 +158,7 @@ if DEV_BUILD
 # (change noinst_ to sbin_ below to install it.)
 #
 noinst_PROGRAMS += pimd/pim6d
-pimd_pim6d_CFLAGS = $(AM_CFLAGS) -DPIM_IPV=6
+pimd_pim6d_CFLAGS = $(AM_CFLAGS) -DPIM_IPV=6 $(and $(PIM_V6_TEMP_BREAK),-DPIM_V6_TEMP_BREAK)
 pimd_pim6d_LDADD = lib/libfrr.la $(LIBCAP)
 endif
 endif