Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 134253 - [baselayout] arping with MAC address recognition
Summary: [baselayout] arping with MAC address recognition
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-24 12:17 UTC by Oldrich Jedlicka
Modified: 2006-06-05 07:33 UTC (History)
0 users

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


Attachments
MAC address recognition patch (arping_sh-mac-address.patch,3.52 KB, patch)
2006-05-24 12:17 UTC, Oldrich Jedlicka
Details | Diff
Wait for some time patch (arping_sh-wait-time.patch,1.62 KB, patch)
2006-05-24 12:18 UTC, Oldrich Jedlicka
Details | Diff
Alternative patch (arping.patch,4.32 KB, patch)
2006-05-31 04:26 UTC, Roy Marples (RETIRED)
Details | Diff
Alternative patch (arping.patch,4.48 KB, patch)
2006-05-31 07:24 UTC, Roy Marples (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oldrich Jedlicka 2006-05-24 12:17:00 UTC
I created an enhancement for arping (all patches against baselayout 1.12.0_pre19-r2) to use also MAC address - if specified. It works like this:

gateways_eth0=( "192.168.0.1[01:23:45:67:89:AB]" )
config_192168000001_0123456789AB=( "192.168.0.200/24" )
xxx_192168000001_0123456789AB=( ... )


The MAC address is converted to uppercase and colons are removed. MAC address is optional and if ommited, the original behaviour is back - if the MAC is not specified, the variable_AAABBBCCCDDD is used as usual. Both configurations (with and without MAC) can be mixed in one gateways_NET variable.

***
There is also another enhancement: to wait some time, before the actual arping is started. I found it useful for me, because when I started arping immediately, there was no response (switch problem). But after some time, the network started to send reply - verified in Ethereal. It can be activated by

arping_eth0="wait"     to wait 5 (default) seconds, or
arping_eth0="wait=10"  to wait specified number of seconds, or
arping="wait"          to wait on all interfaces using arping

Currently the arping wait is not needed, if you use DHCP for configuration and arping as a fallback - the DHCP will wait the same time as the arping would wait. So this is an option for the user, if he uses arping directly and needs some wait timeout.

***
Possible enhancements:

* Cache already received MAC addresses for pinged IPs
* More fail-safe MAC recognition, not only *:*:*:*:*:*
Comment 1 Oldrich Jedlicka 2006-05-24 12:17:31 UTC
Created attachment 87428 [details, diff]
MAC address recognition patch
Comment 2 Oldrich Jedlicka 2006-05-24 12:18:12 UTC
Created attachment 87429 [details, diff]
Wait for some time patch

This should be applied after the MAC address patch.
Comment 3 Roy Marples (RETIRED) gentoo-dev 2006-05-25 03:49:30 UTC
I like the look of this - very nice.

We're in the process of stabalising 1.12 at the present so I'll address this shortly after 1.12 is stable on all arches.

Probably not going to apply the wait patch as the user can always do this

preup() {
   # Sleep for 5 seconds so that the switch can respond to my arping
   [[ ${IFACE} == "eth1" ]] && sleep 5
}
Comment 4 Roy Marples (RETIRED) gentoo-dev 2006-05-31 04:26:26 UTC
Created attachment 87970 [details, diff]
Alternative patch

OK, I've been playing around with this patch, basically taking your idea and refining it a little.

Here's a patch that combines both the above patches.
Different variable setup though - I think this is cleaner.
gateways_lan="192.168.0.1,00:11:22:AA:BB:CC"
arping_sleep_lan=5

Thoughts?
Comment 5 Roy Marples (RETIRED) gentoo-dev 2006-05-31 07:24:16 UTC
Created attachment 87982 [details, diff]
Alternative patch

New patch - fixes a few bugs with my last one and also allows the arping wait time to be changed from the default 3 seconds.
Comment 6 Roy Marples (RETIRED) gentoo-dev 2006-06-05 07:33:37 UTC
Fixed in baselayout-1.12.1