Date: Wed, 14 Apr 1999 13:54:05 -0400 (EDT) From: Larry Lile <lile@stdio.com> To: ip@mcc.ac.uk Cc: current@FreeBSD.ORG Subject: Patch to fix [Re: Bad, reliable crash: Julian's "oltr" stuff & ARP] Message-ID: <Pine.BSF.4.05.9904141308310.3818-200000@heathers.stdio.com> In-Reply-To: <199904121605.RAA47641@albatross.mcc.ac.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-1609105550-924112445=:3818 Content-Type: TEXT/PLAIN; charset=US-ASCII The problem Mr. Pallfreeman was seeing are related to how I was building the arp-reply based on the sources arp_hrd type. I never expected to see a token-ring arp arrive over an ethernet interface. Therefore the arp code was trying to check for and collect the source route that the arp took on its way. I have modified the arp code to go looking for the source-route information only if the arp comes from a token-ring station and is received on a token-ring interface. The arp-reply packet generated is based on the type of interface the arp was received on. I think the bridge should have changed the arp_hrd type when it forwarded the packet, while it was changing everything else, but I think that falls into a religous debate. Thanks to Mr. Pallfreeman for helping me debug this and testing my patch. What this means is: you should be able to arp in both directions over a token-ring<->ethernet (translational|non-translational) bridge. The inherent "brokenness" of translational bridging is left as an exercise for the reader :) Here's the patch, if someone would be kind enough to commit it. It seems to have resolved Mr. Pallfreeman's issue and doesn't seem to break anything else. Larry Lile lile@stdio.com --0-1609105550-924112445=:3818 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="if_ether.c.patch" Content-Transfer-Encoding: BASE64 Content-ID: <Pine.BSF.4.05.9904141354050.3818@heathers.stdio.com> Content-Description: ARP fix Content-Disposition: attachment; filename="if_ether.c.patch" KioqIGlmX2V0aGVyLmMub3JpZwlXZWQgQXByIDE0IDA5OjU0OjM1IDE5OTkN Ci0tLSBpZl9ldGhlci5jCVdlZCBBcHIgMTQgMTI6NTA6MDIgMTk5OQ0KKioq KioqKioqKioqKioqDQoqKiogNTYwLDU2NyAqKioqDQogIAkJKH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PmV0aGVyX2Rob3N0LCBlYS0+YXJwX3RoYSwgc2l6ZW9mKGVoLT5ldGhl cl9kaG9zdCkpOw0KICAJCWVoLT5ldGhlcl90eXBlID0gaHRvbnMoRVRIRVJU WVBFX0FSUCk7DQotLS0gNjY3LDY3MyAtLS0tDQogIAkJc2Euc2FfZGF0YVso c2l6ZW9mKHRoLT5pc284ODAyNV9kaG9zdCkgKiAyKV0gPSAweDEwOw0KICAJ CXNhLnNhX2RhdGFbKHNpemVvZih0aC0+aXNvODgwMjVfZGhvc3QpICogMikg KyAxXSA9IDB4NDA7DQogIAkJYnJlYWs7DQohIAljYXNlIElGVF9FVEhFUjoN CiAgCQllaCA9IChzdHJ1Y3QgZXRoZXJfaGVhZGVyICopc2Euc2FfZGF0YTsN CiAgCQkodm9pZCltZW1jcHkoZWgtPmV0aGVyX2Rob3N0LCBlYS0+YXJwX3Ro YSwgc2l6ZW9mKGVoLT5ldGhlcl9kaG9zdCkpOw0KICAJCWVoLT5ldGhlcl90 eXBlID0gaHRvbnMoRVRIRVJUWVBFX0FSUCk7DQo= --0-1609105550-924112445=:3818-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9904141308310.3818-200000>