Comments (6)
What does "not working" mean? Do the packets go through another interface? Also, could you please reformat the patch using the correct markup?
from iputils.
Oh, I see now. Basically s/probe_fd/sock->fd/. And I can confirm it works as expected. Without the patch, the -I option is just not honored.
from iputils.
Btw, this should probably be fixed for IPv6 as well.
from iputils.
Like this?
diff --git a/ping.c b/ping.c
index 4455091..b8140bc 100644
--- a/ping.c
+++ b/ping.c
@@ -569,7 +569,7 @@ int ping4_run(int argc, char **argv, struct addrinfo *ai, socket_st *sock)
strncpy(ifr.ifr_name, device, IFNAMSIZ-1);
enable_capability_raw();
- rc = setsockopt(probe_fd, SOL_SOCKET, SO_BINDTODEVICE, device, strlen(device)+1);
+ rc = setsockopt(sock->fd, SOL_SOCKET, SO_BINDTODEVICE, device, strlen(device)+1);
disable_capability_raw();
if (rc == -1) {
from iputils.
On Fri, Aug 19, 2016 at 01:06:24PM -0700, pavlix wrote:
Like this?
diff --git a/ping.c b/ping.c
index 4455091..b8140bc 100644
--- a/ping.c
+++ b/ping.c
@@ -569,7 +569,7 @@ int ping4_run(int argc, char **argv, struct addrinfo *ai, socket_st *sock)
strncpy(ifr.ifr_name, device, IFNAMSIZ-1);enable_capability_raw();
rc = setsockopt(probe_fd, SOL_SOCKET, SO_BINDTODEVICE, device, strlen(device)+1);
rc = setsockopt(sock->fd, SOL_SOCKET, SO_BINDTODEVICE, device, strlen(device)+1); disable_capability_raw(); if (rc == -1) {
Yes.
Eugene Berdnikov
from iputils.
#56 fixes both - Interface and IP Address binding and works here as expected.
from iputils.
Related Issues (20)
- Add JSON output
- 'pipe N' line description
- Add an errno return HOT 1
- cross compile error:meson.build:92:0: ERROR: C shared or static library 'm' not found HOT 1
- Capability issue with ping -m HOT 11
- vrf_exec ping sends packets ignoring port gateway HOT 1
- Consider restoring rarpd for booting sparc machines
- actual ping interval value HOT 5
- Patch submission to fix ping interval. HOT 7
- ping: Received an icmp_reply which was not sent by this progress HOT 1
- Ping: Does not show receiving multicast replies HOT 2
- IDEA: -x option to define exit conditions for scripting HOT 5
- ping: potential wrong exit code ? HOT 2
- Unable to build man pages HOT 3
- [RFC] Disable reverse DNS resolution (PTR lookup) HOT 12
- Unsolicited arping exit delayed 1s since "arping: use signalfd() and timerfd() rather than signals" HOT 4
- [RFC] ping rewrite: can be in Rust? HOT 3
- Cannot run multiple arping simultaneously HOT 11
- Possible integer overflow with -s arg HOT 4
- arping: send_pack() return code is ignored, errno value lost
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 iputils.