]> git.proxmox.com Git - mirror_frr.git/commit - ospf6d/ospf6_abr.c
ospf6d: fix logging of border router routes
authorRenato Westphal <renato@opensourcerouting.org>
Thu, 19 Aug 2021 02:07:10 +0000 (23:07 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Tue, 24 Aug 2021 14:53:36 +0000 (11:53 -0300)
commit9142948e39f331231d05e68306c94a51db36c820
treee933dc5589ecc08aafe604ac7c6ec0862bc0a322
parent6df89791ba287a81c947dfb9fbdcd1c4a51db89b
ospf6d: fix logging of border router routes

The prefix of routes to border routers consists of two pieces of
information embedded in a single struct (prefix.u.lp):

  struct prefix {
          uint8_t family;
          uint16_t prefixlen;
          union {
   [snip]
                  struct {
                          struct in_addr id;
                          struct in_addr adv_router;
                  } lp;
          } u __attribute__((aligned(8)));
  };

As such, using prefix2str() (or the %pFX format specifier) isn't
correct when logging such routes.

This commit adds a few special cases here and there to handle
OSPF6_DEST_TYPE_ROUTER routes differently. It'd probably be a good
idea to add a helper function to handle all cases in a single place,
but that can be left for a second moment.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ospf6d/ospf6_abr.c
ospf6d/ospf6_route.c