Jump to content
  • Advertisement
Sign in to follow this  
roby65

Get mac address from udp packet?

This topic is 3750 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys! I have a "little" problem.... I want to make a mac-address ban....is there a way to get mac-address from an udp packet? etheral for example does it... :S

Share this post


Link to post
Share on other sites
Advertisement
Under Windows, you can use arp -a. It relies on ARP protocol though.

I'm not aware of a method to do this for arbitrary IP over WAN.

Share this post


Link to post
Share on other sites
Basically what you see is that the mac address in ethereal is ripped from a UDP packet from the ethernet frame. However, every that is probably not the mac address that you would be most interested in. The mac address of a packet changes for each network device it goes through since the ethernet frame is opened to obtain the source/destination IP's within the IP frame of the packet. This is why you probably won't be able to do very good mac filtering unless there are absolutely no network devices between your two systems (there's no way that I know of doing it through a WAN).

If your looking at doing mac filtering for a game (not sure why you would want to do it) what is possible is that when registering an account or something similar, the mac address of the system is sent as part of the registering process so you would store something like the username, password and mac address then you verify the mac address against the username/password during logon. Or if you don't have to log in, as soon as you connect to the server, during the initial logon stages explicitly pass the mac address of the system logging on and check against a known bad list. Remember that mac addresses are actually not unique so if you ban one, you may be banning several although the probably is pretty low.

Bottom line is you can't pull the mac address from a typical UDP packet reliably to filter unless you aren't expecting any network devices (i.e. if your on a WAN your screwed) between the two systems or pass it explicitly in the UDP data portion.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!