diff -ur linux-2.3.33.djb/drivers/net/tokenring/ibmtr.c linux-2.3.33.djb.ipv6/drivers/net/tokenring/ibmtr.c --- linux-2.3.33.djb/drivers/net/tokenring/ibmtr.c Thu Dec 16 21:25:51 1999 +++ linux-2.3.33.djb.ipv6/drivers/net/tokenring/ibmtr.c Thu Dec 16 22:44:04 1999 @@ -1651,7 +1651,7 @@ ti->tr_stats.rx_packets++; skb->protocol = tr_type_trans(skb,dev); - if (IPv4_p){ + if (IPv4_p && (skb->protocol = ETH_P_IP)){ skb->csum = chksum; skb->ip_summed = 1; } diff -ur linux-2.3.33.djb/include/net/if_inet6.h linux-2.3.33.djb.ipv6/include/net/if_inet6.h --- linux-2.3.33.djb/include/net/if_inet6.h Mon Aug 23 13:01:02 1999 +++ linux-2.3.33.djb.ipv6/include/net/if_inet6.h Thu Dec 16 22:50:07 1999 @@ -119,5 +119,15 @@ memcpy(buf + 2, &addr->s6_addr32[3], sizeof(__u32)); } + +extern __inline__ void ipv6_tr_mc_map(struct in6_addr *addr, char *buf) +{ + buf[0] = 0xC0 ; + buf[1] = 0x00 ; + buf[2] = 0x00 ; + buf[3] = 0x04 ; + buf[4] = 0x00 ; + buf[5] = 0x00 ; +} #endif #endif diff -ur linux-2.3.33.djb/net/ipv6/addrconf.c linux-2.3.33.djb.ipv6/net/ipv6/addrconf.c --- linux-2.3.33.djb/net/ipv6/addrconf.c Fri Nov 19 14:33:29 1999 +++ linux-2.3.33.djb.ipv6/net/ipv6/addrconf.c Thu Dec 16 22:53:37 1999 @@ -670,6 +670,7 @@ { switch (dev->type) { case ARPHRD_ETHER: + case ARPHRD_IEEE802_TR: if (dev->addr_len != ETH_ALEN) return -1; memcpy(eui, dev->dev_addr, 3); @@ -1191,8 +1192,8 @@ ASSERT_RTNL(); - if (dev->type != ARPHRD_ETHER) { - /* Alas, we support only Ethernet autoconfiguration. */ + if ((dev->type != ARPHRD_ETHER) && + (dev->type != ARPHRD_IEEE802_TR)) { return; } @@ -1990,7 +1991,8 @@ case ARPHRD_LOOPBACK: init_loopback(dev); break; - case ARPHRD_ETHER: + case ARPHRD_ETHER: + case ARPHRD_IEEE802_TR: addrconf_dev_config(dev); break; default: diff -ur linux-2.3.33.djb/net/ipv6/ndisc.c linux-2.3.33.djb.ipv6/net/ipv6/ndisc.c --- linux-2.3.33.djb/net/ipv6/ndisc.c Fri Nov 19 14:33:29 1999 +++ linux-2.3.33.djb.ipv6/net/ipv6/ndisc.c Wed Jan 5 10:04:42 2000 @@ -161,6 +161,9 @@ case ARPHRD_FDDI: ipv6_eth_mc_map(addr, buf); return 0; + case ARPHRD_IEEE802_TR: + ipv6_tr_mc_map(addr, buf); + return 0; default: if (dir) { memcpy(buf, dev->broadcast, dev->addr_len); @@ -967,10 +970,25 @@ is unspecified address, it is someone does DAD, otherwise we ignore solicitations until DAD timer expires. + On Token Ring we also see our own + broadcasts. We have to mask them out here. */ - if (addr_type == IPV6_ADDR_ANY) - addrconf_dad_failure(ifp); - else + if (addr_type == IPV6_ADDR_ANY) { + if (dev->type = ARPHRD_IEEE802_TR) { + unsigned char *sadr = skb->mac.raw; + if (((sadr[8] & 0x7f) != (dev->dev_addr[0] & 0x7f)) || + (sadr[9] != dev->dev_addr[1]) || + (sadr[10] != dev->dev_addr[2]) || + (sadr[11] != dev->dev_addr[3]) || + (sadr[12] != dev->dev_addr[4]) || + (sadr[13] != dev->dev_addr[5])) + { + addrconf_dad_failure(ifp) ; + } + } else { + addrconf_dad_failure(ifp); + } + } else in6_ifa_put(ifp); return 0; }