8192 in.ndpd: misleading-indentation

Review Request #487 — Created May 10, 2017 and submitted

tsoome
illumos-gate
8192
aea4d8f...
general
main.c:1870:4: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
    if (pr->pr_state & PR_AUTO)
    ^~
main.c:1872:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
     prefix_delete(pr);
     ^~~~~~~~~~~~~
cc1: all warnings being treated as errors


  • 0
  • 0
  • 0
  • 1
  • 1
Description From Last Updated
marcel
  1. Ship It!
  2. 
      
rm
  1. 
      
  2. How did you determine that this should always be done. I'm having trouble determining if we're only supposed to be deleting all the prefixes regardless of if that was supposed to be bracketed on the PR_AUTO flag. It may be worth reaching out to Seb about that.
    1. Since the code is tearing down the interface bits it did sort of made sense, but indeed, I may have been wrong here. Anyhow, I did ask Seb if he can have time to look on this, meanwhile I will also try to dig in more and see if I can get better understanding about this code.

    2. The change is correct. The code should be doing (pardon the verbose pseudo-code):

      if physical interface pi removed {
              for each prefix p on pi {
                      if prefix is used for address autoconfiguration {
                              delete addresses created from that prefix
                      }
                      delete the prefix
              }
              cleanup remaining pi state
      }
      
    3. So as this is the fix afterall, I'll drop this issue.

  3. 
      
seb@delphix.com
  1. Ship It!
  2. 
      
rm
  1. Ship It!
  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...