Skip to content
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

Merged
merged 2 commits into from
Apr 2, 2021

Conversation

mjstapp
Copy link
Contributor

@mjstapp mjstapp commented Mar 31, 2021

Remove the inet6_ntoa() api from lib/prefix.c - it used a static buffer, etc etc. Looks like it was only used in ripng...

Mark Stapp added 2 commits March 31, 2021 08:32
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>
Copy link

@polychaeta polychaeta left a 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.

@LabN-CI
Copy link
Collaborator

LabN-CI commented Mar 31, 2021

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/8376 b505807
Date 03/31/2021
Start 09:17:39
Finish 09:59:13
Run-Time 41:34
Total 1815
Pass 1815
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2021-03-31-09:17:39.txt
Log autoscript-2021-03-31-09:18:45.log.bz2
Memory 503 501 426

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, 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.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

@donaldsharp donaldsharp merged commit f243fd3 into FRRouting:master Apr 2, 2021
@mjstapp mjstapp deleted the fix_remove_inet6_ntoa branch April 5, 2021 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants