-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib, ripngd: Remove inet6_ntoa #8376
Conversation
Stop using unsafe inet6_ntoa(), just use %pI6. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Remove inet6_ntoa() - used static buffer, not needed. Signed-off-by: Mark Stapp <mjs@voltanet.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution to FRR!
Click for style suggestions
To apply these suggestions:
curl -s https://gist.githubusercontent.com/polychaeta/99569734545358e5e0934707b3b9be84/raw/9d50b35928c8a1b45f15163437e346cc35f14f11/cr_8376_1617194076.diff | git apply
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index 0e8314014..b6b21ed7a 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -342,8 +342,8 @@ void ripng_packet_dump(struct ripng_packet *packet, int size,
rte->prefixlen);
else
zlog_debug(" %pI6/%d metric %d tag %" ROUTE_TAG_PRI,
- &rte->addr, rte->prefixlen,
- rte->metric, (route_tag_t)ntohs(rte->tag));
+ &rte->addr, rte->prefixlen, rte->metric,
+ (route_tag_t)ntohs(rte->tag));
}
}
@@ -395,8 +395,9 @@ static void ripng_nexthop_rte(struct rte *rte, struct sockaddr_in6 *from,
information is ignored, a possibly sub-optimal, but absolutely
valid, route may be taken. If the received next hop address is not
a link-local address, it should be treated as 0:0:0:0:0:0:0:0. */
- zlog_warn("RIPng nexthop RTE with non link-local address %pI6 from %pI6",
- &rte->addr, &from->sin6_addr);
+ zlog_warn(
+ "RIPng nexthop RTE with non link-local address %pI6 from %pI6",
+ &rte->addr, &from->sin6_addr);
nexthop->flag = RIPNG_NEXTHOP_UNSPEC;
memset(&nexthop->address, 0, sizeof(struct in6_addr));
@@ -1196,8 +1197,8 @@ static void ripng_response_process(struct ripng_packet *packet, int size,
inclusive) */
if (rte->prefixlen > 128) {
zlog_warn("Invalid prefix length %pI6/%d from %pI6%%%s",
- &rte->addr, rte->prefixlen,
- &from->sin6_addr, ifp->name);
+ &rte->addr, rte->prefixlen, &from->sin6_addr,
+ ifp->name);
ripng_peer_bad_route(ripng, from);
continue;
}
@@ -2085,8 +2086,7 @@ DEFUN (show_ipv6_ripng,
#endif /* DEBUG */
vty_out(vty, "\n");
vty_out(vty, "%*s", 18, " ");
- len = vty_out(vty, "%pI6",
- &rinfo->nexthop);
+ len = vty_out(vty, "%pI6", &rinfo->nexthop);
len = 28 - len;
if (len > 0)
If you are a new contributor to FRR, please see our contributing guidelines.
After making changes, you do not need to create a new PR. You should perform an amend or interactive rebase followed by a force push.
💚 Basic BGPD CI results: SUCCESS, 0 tests failedResults table
For details, please contact louberger |
Continuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18117/ This is a comment from an automated CI system. |
Remove the inet6_ntoa() api from lib/prefix.c - it used a static buffer, etc etc. Looks like it was only used in ripng...