Date: Mon, 6 Oct 2008 09:56:26 +0400 From: Eygene Ryabinkin <rea-fbsd@codelabs.ru> To: Ryan French <rfrench@freebsd.org> Cc: freebsd-net@freebsd.org Subject: Re: Getting packets MAC source address in if_ethersubr.c Message-ID: <QRmJjlA1bRoSdxjHYKYmYszgnLI@oTsbvnzw1JD5x93fzoTzH8HMIXg> In-Reply-To: <200810061730.23641.rfrench@freebsd.org> References: <200810061730.23641.rfrench@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--M9bFcvWzl0n6AFYF Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Ryan, good day. Mon, Oct 06, 2008 at 05:30:23PM +1300, Ryan French wrote: > I now have receiving,=20 > decoding and sending of packets working, except for one small problem. Wh= en I=20 > send a packet back out the MAC address is wrong. I am looking for a way i= n=20 > the ether_output function in if_ethersubr.c that I can get the MAC addres= s of=20 > the source of the packet and then just send it back to that source. Do you mean by 'the source of the packet' the MAC address of the incoming packet to what you're sending a reply packet? If you can somehow "remember" the MAC address of the packet you're replying to (don't know about internals of your application, so can't judge if it is feasible), you can try to look at the sys/net/if_bridge.c (bridge_enqueue at the first place and bridge_input as the example on how to manipulate the Ethernet header). These might help you, unless you're not using Ethernet as the transport. --=20 Eygene _ ___ _.--. # \`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard / ' ` , __.--' # to read the on-line manual =20 )/' _/ \ `-_, / # while single-stepping the kernel. `-'" `"\_ ,_.-;_.-\_ ', fsc/as # _.-'_./ {_.' ; / # -- FreeBSD Developers handbook=20 {_.-``-' {_/ # --M9bFcvWzl0n6AFYF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkjpqIoACgkQthUKNsbL7YgSvgCgj/MymxDyfk7ejaTT7m6HaTJJ KesAn0mfDKrvNpNfqdBlq5N8QAu47s51 =mupS -----END PGP SIGNATURE----- --M9bFcvWzl0n6AFYF--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?QRmJjlA1bRoSdxjHYKYmYszgnLI>