M boot/bootip.c => boot/bootip.c +1 -1
@@ 134,7 134,7 @@ void
configil(Method*)
{
configip();
- setauthaddr("il", 566);
+ setauthaddr("tcp", 567);
}
int
M ip/devip.c => ip/devip.c +5 -0
@@ 143,6 143,7 @@ ip1gen(Chan *c, int i, Dir *dp)
case Qndb:
p = "ndb";
len = strlen(f->ndb);
+ q.vers = f->ndbvers;
break;
case Qiproute:
p = "iproute";
@@ 160,6 161,8 @@ ip1gen(Chan *c, int i, Dir *dp)
break;
}
devdir(c, q, p, len, network, prot, dp);
+ if(i == Qndb)
+ dp->mtime = f->ndbmtime;
return 1;
}
@@ 1348,6 1351,8 @@ ndbwrite(Fs *f, char *a, ulong off, int n)
error(Eio);
memmove(f->ndb+off, a, n);
f->ndb[off+n] = 0;
+ f->ndbvers++;
+ f->ndbmtime = seconds();
return n;
}
M ip/ethermedium.c => ip/ethermedium.c +13 -3
@@ 550,6 550,16 @@ recvarp(Ipifc *ifc)
break;
case ARPREPLY:
+ /* check for machine using my ip address */
+ v4tov6(ip, e->spa);
+ if(iplocalonifc(ifc, ip) || ipproxyifc(er->f, ifc, ip)){
+ if(memcmp(e->sha, ifc->mac, sizeof(e->sha)) != 0){
+ print("arprep: 0x%E/0x%E also has ip addr %V\n",
+ e->s, e->sha, e->spa);
+ break;
+ }
+ }
+
arpenter(er->f, V4, e->spa, e->sha, sizeof(e->sha), 0);
break;
@@ 558,14 568,14 @@ recvarp(Ipifc *ifc)
if(ifc->lifc == 0)
break;
- /* check for someone that think's they're me */
+ /* check for machine using my ip or ether address */
v4tov6(ip, e->spa);
if(iplocalonifc(ifc, ip) || ipproxyifc(er->f, ifc, ip)){
if(memcmp(e->sha, ifc->mac, sizeof(e->sha)) != 0)
- print("arp: 0x%E also has ip addr %V\n", e->sha, e->spa);
+ print("arpreq: 0x%E also has ip addr %V\n", e->sha, e->spa);
} else {
if(memcmp(e->sha, ifc->mac, sizeof(e->sha)) == 0){
- print("arp: %V also has ether addr %E\n", e->spa, e->sha);
+ print("arpreq: %V also has ether addr %E\n", e->spa, e->sha);
break;
}
}
M ip/ip.h => ip/ip.h +2 -0
@@ 335,6 335,8 @@ struct Fs
Ifclog *ilog;
char ndb[1024]; /* an ndb entry for this interface */
+ int ndbvers;
+ long ndbmtime;
};
/* one per default router known to host */
M pc/pci.c => pc/pci.c +7 -6
@@ 669,7 669,7 @@ pcirouting(void)
router_t *r;
int size, i, fn, tbdf;
Pcidev *sbpci, *pci;
- uchar *p, *m, pin, irq;
+ uchar *p, *m, pin, irq, link;
// Search for PCI interrupt routing table in BIOS
for(p = (uchar *)KADDR(0xf0000); p < (uchar *)KADDR(0xfffff); p += 16)
@@ 723,16 723,17 @@ pcirouting(void)
continue;
m = &e->e_maps[(pin - 1) * 3];
- irq = southbridge->get(sbpci, m[0]);
+ link = m[0];
+ irq = southbridge->get(sbpci, link);
if(irq == 0 || irq == pci->intl)
continue;
if(pci->intl != 0 && pci->intl != 0xFF) {
- print("pcirouting: BIOS workaround: %T at pin %d irq %d -> %d\n",
- tbdf, pin, irq, pci->intl);
- southbridge->set(sbpci, m[0], pci->intl);
+ print("pcirouting: BIOS workaround: %T at pin %d link %d irq %d -> %d\n",
+ tbdf, pin, link, irq, pci->intl);
+ southbridge->set(sbpci, link, pci->intl);
continue;
}
- print("pcirouting: %T at pin %d irq %d\n", tbdf, pin, irq);
+ print("pcirouting: %T at pin %d link %d irq %d\n", tbdf, pin, link, irq);
pcicfgw8(pci, PciINTL, irq);
pci->intl = irq;
}