Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 59534 - Hping won't run on ethernet bridge interfaces
Summary: Hping won't run on ethernet bridge interfaces
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-05 10:07 UTC by Nathan
Modified: 2004-08-20 06:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed support for ethernet bridge patch (hping_bridge_patch,359 bytes, patch)
2004-08-10 09:33 UTC, Nathan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan 2004-08-05 10:07:38 UTC
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;
Comment 1 Eldad Zack (RETIRED) gentoo-dev 2004-08-10 06:46:51 UTC
can you attach the patch as a file?
Comment 2 Nathan 2004-08-10 09:33:24 UTC
Created attachment 37152 [details, diff]
Proposed support for ethernet bridge patch

I added the patch as an attached file.
Comment 3 Nathan 2004-08-10 09:35:21 UTC
Comment on attachment 37152 [details, diff]
Proposed support for ethernet bridge patch

Fixed a typo in the description.
Comment 4 Eldad Zack (RETIRED) gentoo-dev 2004-08-20 06:51:53 UTC
in portage, thanks for the patch.