title: Is length of ethernet header necessarily 14?
body: <p>Code snippet from <a href="https://www.winpcap.org/docs/docs_40_2/html/group__wpcap__tut6.html" rel="nofollow noreferrer">here</a>:</p>
  
  <pre><code>void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data)
  {
      ....
      /* retireve the position of the ip header */
      ih = (ip_header *) (pkt_data +
          14); //length of ethernet header
      ....
  </code></pre>
  
  <p>But this image doesn't say it's necessarily <strong>14</strong>:</p>
  
  <p><a href="https://i.stack.imgur.com/g2gd6.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g2gd6.gif" alt="alt text"></a><br>
  <sub>(source: <a href="http://www.dcs.gla.ac.uk/~lewis/networkpages/m04s03EthernetFrame_files/image002.gif" rel="nofollow noreferrer">lewis at www.dcs.gla.ac.uk</a>)</sub>  </p>
  
  <p>How should I do it properly?</p>