Getting packets MAC source address in if_ethersubr.c

Julian Elischer julian at elischer.org
Mon Oct 6 06:04:55 UTC 2008


Ryan French wrote:
> Hi All,
> 
> For my implementation of MPLS I have just about run out of time for my 
> dissertation so at the moment I am trying to create fake routing table 
> entries e.t.c. rather than doing this properly (I will be doing this once uni 
> is finished and I have more free time to work on it). I now have receiving, 
> decoding and sending of packets working, except for one small problem. When I 
> send a packet back out the MAC address is wrong. I am looking for a way in 
> the ether_output function in if_ethersubr.c that I can get the MAC address of 
> the source of the packet and then just send it back to that source. If anyone 
> knows how to do this without having to use arpresolve or anything like that 
> (the IP address of the destination is not going to be the same as the IP 
> destination in the packet) or without having to setup a proper routing table 
> then it would be much appreciated.
> 
> Thanks,
> -Ryan
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"


You could create a tag type that holds a layer 2 address, and attach 
it to the packet on ingresss,

it should stay with the packet as long as it's not destroyed..
then on egress you could find it and use it..



More information about the freebsd-net mailing list