Bug 229552 - src/sys/net/if_me.c:522]: (style) Suspicious condition
Summary: src/sys/net/if_me.c:522]: (style) Suspicious condition
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-05 20:36 UTC by David Binderman
Modified: 2018-07-09 12:58 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2018-07-05 20:36:39 UTC
src/sys/net/if_me.c:522]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.

Source code is

       if (sc == NULL || !ME_READY(sc) ||
            (ifp->if_flags & IFF_MONITOR) != 0 ||
            (ifp->if_flags & IFF_UP) == 0 ||
            (error = me_check_nesting(ifp, m) != 0)) {

maybe better code

       if (sc == NULL || !ME_READY(sc) ||
            (ifp->if_flags & IFF_MONITOR) != 0 ||
            (ifp->if_flags & IFF_UP) == 0 ||
            (error = me_check_nesting(ifp, m)) != 0) {
Comment 1 Andrey V. Elsukov freebsd_committer freebsd_triage 2018-07-09 12:58:39 UTC
Fixed in r336131. Thanks!