title: C Logical operators on if statement OR AND
body: <p>Something is wrong with this logic it detects everything and prints <code>bad pkt detected</code>.  </p>
  
  <pre><code>if((buff[0] != 0x0a || buff[0] != 0x0e) &amp;&amp; (len == 210))
  {
      printf("badpkt detected from %s\n", xpi);
  } else {
      if(mysend(ssl_sd ? ssl_sd[i] : NULL, sd[i], buff, len) &lt;= 0) MULTI_SKIP_QUIT
  }
  </code></pre>
  
  <p>The logic is DENY all packets that are 210 in length. Except if the 1st byte is 0x0A or 0x0E.</p>
  
  <p>This code is working though:</p>
  
  <pre><code>if((buff[0] != 0x0a) &amp;&amp; (len == 210))
  {
      printf("badpkt detected from %s\n", xpi);
  } else {
      if(mysend(ssl_sd ? ssl_sd[i] : NULL, sd[i], buff, len) &lt;= 0) MULTI_SKIP_QUIT
  }
  </code></pre>
  
  <p>But I need both <code>0x0a</code> and <code>0x0e</code> to be the only 210 length packet allowed.</p>
  
  <p><em>edit</em></p>
  
  <p>What was I thinking, maybe its the lack of sleep.</p>