Plan 9 from Bell Labs’s /usr/web/sources/contrib/yk/dist/9legacy/applied/ip-ipconfig-ipv6-dup.diff

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


--- /n/sources/plan9/sys/src/cmd/ip/ipconfig/ipv6.c	Thu Dec 13 21:44:16 2012
+++ /sys/src/cmd/ip/ipconfig/ipv6.c	Tue Feb  2 00:00:00 2016
@@ -385,8 +385,8 @@
 int
 ip6cfg(int autoconf)
 {
-	int dupfound = 0, n;
-	char *p;
+	int dupfound = 0, n, nf;
+	char *p, *fields[4];
 	char buf[256];
 	uchar ethaddr[6];
 	Biobuf *bp;
@@ -433,7 +433,8 @@
 	snprint(buf, sizeof buf, "%I", conf.laddr);
 	while(p = Brdline(bp, '\n')){
 		p[Blinelen(bp)-1] = 0;
-		if(cistrstr(p, buf) != 0) {
+		nf = tokenize(p, fields, nelem(fields));
+		if(nf >= 4 && cistrcmp(fields[2], buf) == 0) {
 			warning("found dup entry in arp cache");
 			dupfound = 1;
 			break;

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].