From: "Christopher Friesen" <cfriesen@nortelnetworks.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-net@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: interesting problem with raw sockets
Date: Thu, 26 Apr 2001 14:02:15 -0400 [thread overview]
Message-ID: <3AE862A7.60D12F62@nortelnetworks.com> (raw)
In-Reply-To: <E14pqyb-0004bf-00@the-village.bc.nu>
I have a piece of code that is trying to use sendmsg() on a raw socket to inject
a UDP packet onto an ethernet link. The destination IP address is set to
another machine on the same subnet, and the packet arrives at its destination.
Thus far all is well.
However, inspection of the ethernet headers using tcpdump shows that rather than
being addressed directly to the MAC address of the destination, the packet is
instead being sent to the gateway, which then appears to forward it on to the
destination. It almost appears as though the kernel doesn't realize that the IP
address is on the same subnet.
Here's where it gets interesting. I grabbed what I thought was all the socket
setup and sending code from the misbehaving application and stuck them into a
tiny program that builds and sends empty packets with arbitrary source and
destination addresses. Tcpdump shows this program behaving as expected--ie the
destination MAC address in the ethernet header is set to the MAC address of the
destination, not the MAC address of the gateway.
Does anyone have any clue what might be going on? I'm almost ready to try
strace and kernel debugging....
Thanks,
Chris
--
Chris Friesen | MailStop: 043/33/F10
Nortel Networks | work: (613) 765-0557
3500 Carling Avenue | fax: (613) 765-2986
Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com
prev parent reply other threads:[~2001-04-26 18:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-18 7:25 change_mtu boundary checking error Hen, Shmulik
2001-04-18 12:22 ` Alan Cox
2001-04-26 18:02 ` Christopher Friesen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3AE862A7.60D12F62@nortelnetworks.com \
--to=cfriesen@nortelnetworks.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox