Giter VIP home page Giter VIP logo

arping's People

Contributors

bboreham avatar bersoare avatar brb avatar j-keck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

arping's Issues

Malformed gARP packet

Hello,

I would like to use this Go arping implementation in a containerized (k8s) environment for CNI purposes.
I started a Pod(1), which has eth1 interface for packet capturing.
I started another Pod(2), which has eth1 as follows:

105: eth1@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc noqueue state UNKNOWN group default
    link/ether fa:16:3e:41:8e:6b brd ff:ff:ff:ff:ff:ff
    inet 10.100.20.101/24 brd 10.100.20.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fc00:caa5:1:a:f816:3eff:fe30:16bf/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::fa16:3e00:541:8e6b/64 scope link
       valid_lft forever preferred_lft forever

When Pod(2) was created, our custom CNI sent gARP packet using this Go implementation. That is the first packet in the capture below. Inside Pod(2) I executed "arping -c1 -A -I eth1 10.100.20.101" (arping binary from centos repo) as a reference, that is the last packet in the capture file.

The problem is that the gARP packet send by this Go implementation is malformed (as it is reported by Wireshark v3), so I'm not sure whether it is really working.

The packet capture is attached here:
garp.zip

Can you please check what's wrong?
Thanks!

No matching arp response on MacOS

Hi,

I'm testing the arping cli on MacOS and I've the problem that I get no matching response.

sudo -E ./arping -t 1s -v 192.168.2.3                                                                                        holger@happle
Password:
search usable interface
 OTHER NET:    lo0                     up|loopback|multicast
      DOWN:   gif0                     pointtopoint|multicast
      DOWN:   stf0                     0
    USABLE:    en0  20:c9:d0:7a:fa:31  up|broadcast|multicast
search available /dev/bpfX
  open failed: /dev/bpf0 - open /dev/bpf0: resource busy
  open failed: /dev/bpf1 - open /dev/bpf1: resource busy
  open success: /dev/bpf2
arping '192.168.2.3' over interface: 'en0' with address: '192.168.2.211'
ignore received arp: srcIP: '<nil>', srcMac: '02:d3:ff:ff:ff:ff:ff:ff:c0:a8:02:03'
ignore received arp: srcIP: '<nil>', srcMac: '02:03:20:c9:d0:7a:fa:31:c0:a8:02:d3:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00'
ignore received arp: srcIP: '<nil>', srcMac: '02:e2:00:00:00:00:00:00:c0:a8:02:01:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00'
timeout

With the "original" arping I get a response:

/usr/local/sbin/arping 192.168.2.3                                                                                           holger@happle
ARPING 192.168.2.3
60 bytes from b8:27:eb:c4:2e:5f (192.168.2.3): index=0 time=5.100 msec

I've captured the packets also with Wireshark and arping (the go version) was correct in the number of responses. There are 3 arp packets. The first one was a correct reply, but somehow arping could not recognize it.
Any ideas?

variables number error

arping.go:120:12: assignment mismatch: 2 variables but initialize returns 1 value
arping.go:207:12: assignment mismatch: 2 variables but initialize returns 1 value

goroutines leak

Use arping package like this:

var arpSyncInterval := time.NewTicker(time.Second * 10)
go loopForARP(dstIp);

func loopForARP(dstIp) {
    for _ = range arpSyncInterval .C {
         mac, _, err := arping.Ping(dstIp)
         if err != nil {
   		log.WithError(err).Errorf("send arp ping failed")
   		continue
         }
         // doSomethingWithMac()
    }
}

The goroutines continuously rising when dstIp is unreachable.
There are same goroutine like this:
image

I review the code of arping.Ping(), expect that it will stop the goroutine when arping timeout. but the result doesn't meet.
image

Is the usage wrong for the arping package?or misunderstanding for the goroutine?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.