2009/10/15 Ben Sapp wrote: > Hello, > > I was looking at ping/ping.c and noticed what might be an issue with the > socket_type variable. Both the -r and -d option set socket_type directly > rather than perform an |= like is done with the option variable. The result > would seem to be that the -r and -d option are mutually exclusive when they > don't need to be. > [..]
Thanks for reporting. Your argument seems right to me. @Alfred May you review the patch and confirm above ? Thanks, -- Rakesh Pandit https://fedoraproject.org/ freedom, friends, features, first >From efe9e935ae0507af72e26aa97931b3d9a9bd0141 Mon Sep 17 00:00:00 2001 From: Rakesh Pandit <[email protected]> Date: Tue, 20 Oct 2009 11:52:59 +0530 Subject: [PATCH] Removed mutual exclusion for `r' and 'd' options and fixed `r' option for ping6. --- ChangeLog | 7 +++++++ ping/ping.c | 4 ++-- ping/ping6.c | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4fbbee7..6c7579b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-10-20 rakesh <[email protected]> + + * ping/ping.c (parse_opt): Replace `=' with `|=' for `d' and `r' + option. + * ping/ping6.c (parse_opt): Replace SO_DEBUG with SO_DONTROUTE for + `r' option. Replace `=' with `|=' for `d' and `r' option. + 2009-10-10 Giuseppe Scrivano <[email protected]> * TODO: Updated. diff --git a/ping/ping.c b/ping/ping.c index e3be687..b194c38 100644 --- a/ping/ping.c +++ b/ping/ping.c @@ -144,7 +144,7 @@ parse_opt (int key, char *arg, struct argp_state *state) break; case 'd': - socket_type = SO_DEBUG; + socket_type |= SO_DEBUG; break; case 'i': @@ -158,7 +158,7 @@ parse_opt (int key, char *arg, struct argp_state *state) break; case 'r': - socket_type = SO_DONTROUTE; + socket_type |= SO_DONTROUTE; break; case 's': diff --git a/ping/ping6.c b/ping/ping6.c index bf89352..a65b875 100644 --- a/ping/ping6.c +++ b/ping/ping6.c @@ -110,7 +110,7 @@ parse_opt (int key, char *arg, struct argp_state *state) break; case 'd': - socket_type = SO_DEBUG; + socket_type |= SO_DEBUG; break; case 'f': @@ -150,7 +150,7 @@ parse_opt (int key, char *arg, struct argp_state *state) break; case 'r': - socket_type = SO_DEBUG; + socket_type |= SO_DONTROUTE; break; case 'w': -- 1.6.2.5
