Comments (8)
The generated packet shows up as:
11:51:10.506344 12:34:56:78:9a:bc > ba:98:76:54:32:10, ethertype ARP (0x0806), length 58: Reply 192.168.0.100 is-at 12:34:56:78:9a:bc, length 44
It's been a while since Iooked at the spec, but essentially seems to mean "me".
So it's not so much a bug as a missing feature. "Target" here does intend to mean, and does mean, where to send the ethernet frame. A different address in the ARP reply target field needs a different option.
Did you try -U
?
But yes, it's not possible to set that ARP field to something specific at the moment. Maybe it should be, with another option.
from arping.
I've read your code and changed this line: (line 1128 of arping.c)
unsolicited ? (uint8_t*)ethxmas : (uint8_t*)ethnull,
to
unsolicited ? (uint8_t*)ethxmas : send_reply ? dstmac : (uint8_t*)ethnull,
So that when replying, set the target address the same as the destination address; but when not replying (requesting) just let that field be nulls.
The image shows the altered code working correctly to set the Target MAC Address, inspected with Wireshark. (You can use wireshark using the original version to see the Target MAC Address is not set using -t, only the Ethernet destination mac)
-U
will set all bits on Target MAC Address (Broadcast).
May i open a pull request for this?
from arping.
Did you try if -U
was sufficient? Are you saying it works with your patch, but not with -U
?
If that's the case, then yeah a PR sounds good. Place some parenthesis for ease of reading, though.
from arping.
Yes, i works with my patch but not with -U
. As i'm replying, it can't be unsolicited because a machine made the request, and i'm replying so i shouldn't be using -U
anyways.
Placing -U
in the command will set the Target MAC Address as FF:FF:FF:FF:FF:FF, when it should be ba:98...
The code i modified does a simple thing: When -U
, Target MAC Address is broadcast. If replying, the Target MAC Address will be the MAC address of the target machine (I've never seen an ARP Reply with Target MAC Address null, so it should be this way). if none then it is a normal request so the field needs to be blank.
If you agree i'll proceed to make a pull request for this. (happy to contribute!)
from arping.
Yeah, makes sense. I'm only being careful in case someone, somewhere, is relying on it. But sending replies is rare with arping, so Should Be Fineβ’.
Just the parenthesis thing, and all good.
from arping.
Sounds right. Prolly they don't exist or if they exist, the machine being replied to doesn't check the if the Target MAC Address matches their machine (which is improbable).
About the parenthesis, is this alright to you? Couldn't really figure out exactly how you wanted.
unsolicited ? (uint8_t*)ethxmas : (send_reply ? dstmac : (uint8_t*)ethnull),
from arping.
Yeah, like that. No need for reader to have to think about operator precedence and associativity.
(PHP's ternary operator is incorrectly associative. Fun fact)
from arping.
Closed this issue by PR #46. Thanks!
from arping.
Related Issues (20)
- configure: error: libnet 1.1.x not found HOT 9
- -bash: ./configure: No such file or directory ? HOT 1
- Getting Timeout on mac and FreeBsd HOT 3
- No ./configure. Bootstrap looks for autoreconf which is not provided :/ HOT 2
- False positives when the pinging machine receives ARP requests at the same time HOT 2
- Cross compiling Arping causes multiple definitions error HOT 3
- Retrieve unknown IP if Mac is known HOT 3
- libnet_get_hwaddr(): socket: Permission denied HOT 4
- arping: libnet_init(LIBNET_LINK, <null>): <no error message> HOT 38
- RFE: support the -f option for iputils arping compatibility HOT 3
- Fail to ping device by MAC address HOT 3
- arping_test compile failure HOT 8
- unsupport libnet 1.2 and libnet 1.1.2.1 HOT 1
- unicast HOT 1
- arping on macOS 10.11.6 not working HOT 4
- Compilation error HOT 1
- How security vulnerabilities for this package is tracked in NIST/NVD? HOT 4
- Build error under Termux (Android) HOT 23
- No replies received using vlan option with older libpcap HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arping.