shithub: riscv

Download patch

ref: e49f7fc1f7435de94a632fea0dc7753b58570eb8
parent: 831291e5dd0877cc130f168a487531fd4a8c410b
author: cinap_lenrek <[email protected]>
date: Sat Aug 11 12:18:12 EDT 2018

devip: fix multicastarp() when ipconfig assigned the 0 address

sending multicast was broken when ipconfig assigned the 0
address for dhcp as they would wrongly classified as Runi.

this could happen when we do slaac and dhcp in parallel,
breaking the sending of router solicitations.

--- a/sys/src/9/ip/ethermedium.c
+++ b/sys/src/9/ip/ethermedium.c
@@ -717,14 +717,9 @@
 multicastarp(Fs *f, Arpent *a, Medium *medium, uchar *mac)
 {
 	/* is it broadcast? */
-	switch(ipforme(f, a->ip)){
-	case Runi:
-		return nil;
-	case Rbcast:
-		memset(mac, 0xff, 6);
+	if(ipforme(f, a->ip) == Rbcast){
+		memset(mac, 0xff, medium->maclen);
 		return arpresolve(f->arp, a, medium, mac);
-	default:
-		break;
 	}
 
 	/* if multicast, fill in mac */