diff options
| author | Quentin Young <qlyoung@users.noreply.github.com> | 2021-02-05 14:08:37 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-05 14:08:37 -0500 |
| commit | 684b9f244755253f81d01bbb822087fdfe37a9de (patch) | |
| tree | e5de4706eee6277990a726b81f051326649d7d55 /ospf6d/ospf6_intra.c | |
| parent | 503f20e40e26e6c4cde3d4fe92ec6379f57b9852 (diff) | |
| parent | 8e04b88b8db4b6c154686c0d43ca192f041072b8 (diff) | |
Merge pull request #7981 from gromit1811/fix_ospf6_lsa_str_retval
ospf6d: Fix LSA formatting inconsistent retvals
Diffstat (limited to 'ospf6d/ospf6_intra.c')
| -rw-r--r-- | ospf6d/ospf6_intra.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c index 01e4b31c4e..fd154e7ee5 100644 --- a/ospf6d/ospf6_intra.c +++ b/ospf6d/ospf6_intra.c @@ -84,12 +84,13 @@ static char *ospf6_router_lsa_get_nbr_id(struct ospf6_lsa *lsa, char *buf, inet_ntop(AF_INET, &lsdesc->neighbor_router_id, buf2, sizeof(buf2)); sprintf(buf, "%s/%s", buf2, buf1); + + return buf; } - } else - return NULL; + } } - return buf; + return NULL; } static int ospf6_router_lsa_show(struct vty *vty, struct ospf6_lsa *lsa, @@ -444,14 +445,15 @@ static char *ospf6_network_lsa_get_ar_id(struct ospf6_lsa *lsa, char *buf, if ((current + sizeof(struct ospf6_network_lsdesc)) <= end) { lsdesc = (struct ospf6_network_lsdesc *)current; - if (buf) + if (buf) { inet_ntop(AF_INET, &lsdesc->router_id, buf, buflen); - } else - return NULL; + return buf; + } + } } - return (buf); + return NULL; } static int ospf6_network_lsa_show(struct vty *vty, struct ospf6_lsa *lsa, @@ -901,7 +903,7 @@ static char *ospf6_intra_prefix_lsa_get_prefix_str(struct ospf6_lsa *lsa, } } while (current <= end); } - return (buf); + return NULL; } static int ospf6_intra_prefix_lsa_show(struct vty *vty, struct ospf6_lsa *lsa, |
