patch - arp responding overenthusastically?

Tom Yates (tyates@etrade.co.uk)
Thu, 30 Sep 1999 11:10:01 +0100 (BST)


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.

--17457665-1093367216-938527484=:12713
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-ID: <Pine.LNX.4.10.9909281504511.12713@teaparty.esi.co.uk>

ladies, gentlemen:

i'm posting this on behalf of a colleague here, dr. david robinson, to
whom replies should be directed.

the odd behaviour we've found is that when an arp request is received with
a target IP address of a local interface, the response contains the MAC
address of the receiving interface rather than the target interface.

the fix in this this patch ensures that arp responses for a local
interface are only replied to using that interface. the patch is against
arp.c as it appeared in 2.2.11, btw.

david also adds that "It also provides a performance improvement;
currently ip_route_input() is called for every arp request on the network
where the target machine is not the local machine. With this patch,
routing is only tried if IP forwarding is enabled on the interface."

thanks to clayton weaver <cgweav@eskimo.com> for the pointer here.

Tom Yates T: 01223 727 400
E*TRADE UK Ltd. www.etrade.co.uk

The contents of this message should be read in conjunction with
the document found at http://www.etrade.co.uk/public/signature.html

--17457665-1093367216-938527484=:12713
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="arp.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.10.9909281504440.12713@teaparty.esi.co.uk>
Content-Description: patch
Content-Disposition: ATTACHMENT; FILENAME="arp.patch"

LS0tIGxpbnV4L25ldC9pcHY0L2FycC5jLm9yaWcJTW9uIEF1ZyAgOSAyMDow
NDo0MSAxOTk5DQorKysgbGludXgvbmV0L2lwdjQvYXJwLmMJVGh1IEF1ZyAy
NiAwOTo1NjowMiAxOTk5DQpAQCAtNjQ5LDI1ICs2NDksMjMgQEANCiAJLyog
U3BlY2lhbCBjYXNlOiBJUHY0IGR1cGxpY2F0ZSBhZGRyZXNzIGRldGVjdGlv
biBwYWNrZXQgKFJGQzIxMzEpICovDQogCWlmIChzaXAgPT0gMCkgew0KI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V0FSRChpbl9kZXYpICYmDQorCQkJICAg
aXBfcm91dGVfaW5wdXQoc2tiLCB0aXAsIHNpcCwgMCwgZGV2KSA9PSAwKSB7
DQorICAgICAgICAgICAgICAgICAgCXJ0ID0gKHN0cnVjdCBydGFibGUqKXNr
Yi0+ZHN0Ow0KKwkJICAgICAgICBhZGRyX3R5cGUgPSBydC0+cnRfdHlwZTsN
CiAJCQlpZiAoKHJ0LT5ydF9mbGFncyZSVENGX0ROQVQpIHx8DQogCQkJICAg
IChhZGRyX3R5cGUgPT0gUlROX1VOSUNBU1QgICYmIHJ0LT51LmRzdC5kZXYg
IT0gZGV2ICYmDQogCQkJICAgICAoSU5fREVWX1BST1hZX0FSUChpbl9kZXYp
IHx8IHBuZWlnaF9sb29rdXAoJmFycF90YmwsICZ0aXAsIGRldiwgMCkpKSkg
ew0K
--17457665-1093367216-938527484=:12713--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/