Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 131746 Details for
Bug 180888
arping needs alternate setting for some routers
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
arping.sh patch for source address
arping.sh.patch (text/plain), 2.92 KB, created by
Conway S. Smith
on 2007-09-24 06:49:00 UTC
(
hide
)
Description:
arping.sh patch for source address
Filename:
MIME Type:
Creator:
Conway S. Smith
Created:
2007-09-24 06:49:00 UTC
Size:
2.92 KB
patch
obsolete
>--- arping.sh_baselayout-1.12.10-r4 2007-09-23 23:04:07.000000000 -0600 >+++ arping.sh 2007-09-24 00:04:10.000000000 -0600 >@@ -46,7 +46,7 @@ > # If neither arping (net-misc/iputils) or arping2 (net-analyzer/arping) > # is installed then we return 1 > arping_address_exists() { >- local iface="$1" ip="${2%%/*}" mac="$3" foundmac= i= w= >+ local iface="$1" ip="${2%%/*}" mac="$3" foundmac= i= w= ipndot= > > # We only handle IPv4 addresses > [[ ${ip} != *.*.*.* ]] && return 1 >@@ -61,18 +61,34 @@ > arping_sleep > > local ifvar=$(bash_variable "${iface}") >+ >+ for i in ${ip//./ } ; do >+ if [[ ${#i} == "2" ]] ; then >+ ipndot="${ipndot}0${i}" >+ elif [[ ${#i} == "1" ]] ; then >+ ipndot="${ipndot}00${i}" >+ else >+ ipndot="${ipndot}${i}" >+ fi >+ done >+ >+ local source="arping_source_${ipndot}" >+ source="${!source}" >+ [[ -z ${source} ]] && source="${arping_source:-0}" >+ > w="arping_wait_${ifvar}" > w="${!w}" > [[ -z ${w} ]] && w="${arping_wait:-3}" > >- if [[ -x /sbin/arping ]] ; then >- foundmac=$(arping -c 2 -w "${w}" -D -f -I "${iface}" \ >- "${ip}" 2>/dev/null \ >- | sed -n 's/.*\[\([^]]*\)\].*/\U\1/p') >- elif [[ -x /usr/sbin/arping2 ]] ; then >+ if [[ -x /usr/sbin/arping2 ]] ; then > for (( i=0; i<w; i++ )) ; do >- foundmac=$(arping2 -r -0 -c 1 -i "${iface}" \ >- "${ip}" 2>/dev/null) >+ if [[ ${source} == "0" ]] ; then >+ foundmac=$(arping2 -r -0 -c 1 -i "${iface}" \ >+ "${ip}" 2>/dev/null) >+ else >+ foundmac=$(arping2 -r -S ${source} -c 1 -i "${iface}" \ >+ "${ip}" 2>/dev/null) >+ fi > if [[ $? == "0" ]] ; then > foundmac=$(echo "${foundmac}" \ > | tr '[:lower:]' '[:upper:]') >@@ -80,6 +96,16 @@ > fi > foundmac= > done >+ elif [[ -x /sbin/arping ]] ; then >+ if [[ ${source} == "0" ]] ; then >+ foundmac=$(arping -c 2 -w "${w}" -D -f -I "${iface}" \ >+ "${ip}" 2>/dev/null \ >+ | sed -n 's/.*\[\([^]]*\)\].*/\U\1/p') >+ else >+ foundmac=$(arping -c 2 -w "${w}" -s ${source} -f -I "${iface}" \ >+ "${ip}" 2>/dev/null \ >+ | sed -n 's/.*\[\([^]]*\)\].*/\U\1/p') >+ fi > fi > > [[ -z ${foundmac} ]] && return 1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 180888
: 131746 |
134894
|
134896