title: Issue reading packets from a pcap file. dpkt module. What gives?
body: <p>I am running the following test script to try to read packets from a sample <code>.pcap</code> file I have downloaded.  It won't seem to run.  I have all of the modules, but no examples seem to be running.</p>
  
  <pre><code>import socket
  import dpkt
  import sys
  pcapReader = dpkt.pcap.Reader(file("test1.pcap", "rb"))
  for ts, data in pcapReader:
      ether = dpkt.ethernet.Ethernet(data)
      if ether.type != dpkt.ethernet.ETH_TYPE_IP: raise
      ip = ether.data
      src = socket.inet_ntoa(ip.src)
      dst = socket.inet_ntoa(ip.dst)
      print "%s -&gt; %s" % (src, dst)
  </code></pre>
  
  <p>For some reason, this is not being interpreted properly.  When running it, I get </p>
  
  <pre><code>KeyError: 138
  
  module body   in test.py at line 4
  function __init__     in pcap.py at line 105
  Program exited.
  </code></pre>
  
  <p>Why is this?  What's wrong?  Is there an issue with my installation?  I'm using Python 2.6 on a mac</p>