All of lore.kernel.org
 help / color / mirror / Atom feed
* Fw: [Bug 84061] New: net/batman-adv/gateway_client.c:813: missing sanity check and dodgy coding ?
@ 2014-09-09  0:30 Stephen Hemminger
  2014-09-09 15:02   ` [B.A.T.M.A.N.] " Antonio Quartulli
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2014-09-09  0:30 UTC (permalink / raw)
  To: netdev



Begin forwarded message:

Date: Mon, 8 Sep 2014 00:04:40 -0700
From: "bugzilla-daemon@bugzilla.kernel.org" <bugzilla-daemon@bugzilla.kernel.org>
To: "stephen@networkplumber.org" <stephen@networkplumber.org>
Subject: [Bug 84061] New: net/batman-adv/gateway_client.c:813: missing sanity check and dodgy coding ?


https://bugzilla.kernel.org/show_bug.cgi?id=84061

            Bug ID: 84061
           Summary: net/batman-adv/gateway_client.c:813: missing sanity
                    check and dodgy coding ?
           Product: Networking
           Version: 2.5
    Kernel Version: 3.17-rc4
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Other
          Assignee: shemminger@linux-foundation.org
          Reporter: dcb314@hotmail.com
        Regression: No

net/batman-adv/gateway_client.c:813:31: warning: logical not is only applied to
the left hand side of comparison [-Wlogical-not-parentheses]

    gw_node = batadv_gw_node_get(bat_priv, orig_dst_node);
    if (!gw_node->bandwidth_down == 0)
        goto out;

Function batadv_gw_node_get can return NULL, so there's
a missing sanity check there and maybe the if condition
can be reworked for clarity.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fw: [Bug 84061] New: net/batman-adv/gateway_client.c:813: missing sanity check and dodgy coding ?
  2014-09-09  0:30 Fw: [Bug 84061] New: net/batman-adv/gateway_client.c:813: missing sanity check and dodgy coding ? Stephen Hemminger
@ 2014-09-09 15:02   ` Antonio Quartulli
  0 siblings, 0 replies; 3+ messages in thread
From: Antonio Quartulli @ 2014-09-09 15:02 UTC (permalink / raw)
  To: Stephen Hemminger,
	The list for a Better Approach To Mobile Ad-hoc Networking
  Cc: netdev

[-- Attachment #1: Type: text/plain, Size: 1634 bytes --]

forwarding to the batman-adv mailing list and commenting inline.

On 09/09/14 02:30, Stephen Hemminger wrote:
> 
> 
> Begin forwarded message:
> 
> Date: Mon, 8 Sep 2014 00:04:40 -0700
> From: "bugzilla-daemon@bugzilla.kernel.org" <bugzilla-daemon@bugzilla.kernel.org>
> To: "stephen@networkplumber.org" <stephen@networkplumber.org>
> Subject: [Bug 84061] New: net/batman-adv/gateway_client.c:813: missing sanity check and dodgy coding ?
> 
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=84061
> 
>             Bug ID: 84061
>            Summary: net/batman-adv/gateway_client.c:813: missing sanity
>                     check and dodgy coding ?
>            Product: Networking
>            Version: 2.5
>     Kernel Version: 3.17-rc4
>           Hardware: All
>                 OS: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: Other
>           Assignee: shemminger@linux-foundation.org
>           Reporter: dcb314@hotmail.com
>         Regression: No
> 
> net/batman-adv/gateway_client.c:813:31: warning: logical not is only applied to
> the left hand side of comparison [-Wlogical-not-parentheses]
> 
>     gw_node = batadv_gw_node_get(bat_priv, orig_dst_node);
>     if (!gw_node->bandwidth_down == 0)
>         goto out;

I think this was meant to be:

if (!gw_node || (gw_node->bandwidth_down == 0))

> 
> Function batadv_gw_node_get can return NULL, so there's
> a missing sanity check there and maybe the if condition
> can be reworked for clarity.
> 

-- 
Antonio Quartulli


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [B.A.T.M.A.N.] Fw: [Bug 84061] New: net/batman-adv/gateway_client.c:813: missing sanity check and dodgy coding ?
@ 2014-09-09 15:02   ` Antonio Quartulli
  0 siblings, 0 replies; 3+ messages in thread
From: Antonio Quartulli @ 2014-09-09 15:02 UTC (permalink / raw)
  To: Stephen Hemminger,
	The list for a Better Approach To Mobile Ad-hoc Networking
  Cc: netdev

[-- Attachment #1: Type: text/plain, Size: 1634 bytes --]

forwarding to the batman-adv mailing list and commenting inline.

On 09/09/14 02:30, Stephen Hemminger wrote:
> 
> 
> Begin forwarded message:
> 
> Date: Mon, 8 Sep 2014 00:04:40 -0700
> From: "bugzilla-daemon@bugzilla.kernel.org" <bugzilla-daemon@bugzilla.kernel.org>
> To: "stephen@networkplumber.org" <stephen@networkplumber.org>
> Subject: [Bug 84061] New: net/batman-adv/gateway_client.c:813: missing sanity check and dodgy coding ?
> 
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=84061
> 
>             Bug ID: 84061
>            Summary: net/batman-adv/gateway_client.c:813: missing sanity
>                     check and dodgy coding ?
>            Product: Networking
>            Version: 2.5
>     Kernel Version: 3.17-rc4
>           Hardware: All
>                 OS: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: Other
>           Assignee: shemminger@linux-foundation.org
>           Reporter: dcb314@hotmail.com
>         Regression: No
> 
> net/batman-adv/gateway_client.c:813:31: warning: logical not is only applied to
> the left hand side of comparison [-Wlogical-not-parentheses]
> 
>     gw_node = batadv_gw_node_get(bat_priv, orig_dst_node);
>     if (!gw_node->bandwidth_down == 0)
>         goto out;

I think this was meant to be:

if (!gw_node || (gw_node->bandwidth_down == 0))

> 
> Function batadv_gw_node_get can return NULL, so there's
> a missing sanity check there and maybe the if condition
> can be reworked for clarity.
> 

-- 
Antonio Quartulli


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-09 15:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-09  0:30 Fw: [Bug 84061] New: net/batman-adv/gateway_client.c:813: missing sanity check and dodgy coding ? Stephen Hemminger
2014-09-09 15:02 ` Antonio Quartulli
2014-09-09 15:02   ` [B.A.T.M.A.N.] " Antonio Quartulli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.