On linux, Hping looks at the name of the network interface to decide what type of a network it is on. For ethernet networks it wants to see "eth#" where # is any number. Ethernet bridges typically have interfaces names "br#" where # is any number. I've patched the source so that it treats br# interfaces the same as eth# interfaces. This patch has been submitted to the Hping development site, but I thought I would post it here as an optional patch for any other Gentoo users who would like to use hping on their ethernet bridge. This patch may be incorporated into the hping source in the future. When that happens, I will post an additional comment here. Reproducible: Always Steps to Reproduce: 1. Set your box up as an ethernet bridge 2. Try to run Hping 3. Notice that it aborts. Actual Results: Nothing, it just exits with a short error message. Expected Results: Run the supplied command. Here's a patch in unified output: --- getlhs.c.old 2004-08-05 09:20:35.320759304 -0600 +++ getlhs.c 2004-08-05 09:12:40.330968728 -0600 @@ -93,6 +93,9 @@ } else if ( strstr(ifname, "eth") ) { linkhdr_size = ETHHDR_SIZE; return 0; + } else if ( strstr(ifname, "br") ) { + linkhdr_size = ETHHDR_SIZE; + return 0; } else if (strstr(ifname, "ets")) { linkhdr_size = 0; return 0;
can you attach the patch as a file?
Created attachment 37152 [details, diff] Proposed support for ethernet bridge patch I added the patch as an attached file.
Comment on attachment 37152 [details, diff] Proposed support for ethernet bridge patch Fixed a typo in the description.
in portage, thanks for the patch.