scroot / gopacket

Automatically exported from code.google.com/p/gopacket
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

DecodingLayerParser example error #49

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The DecodingLayerParser example in doc.go has a minor error. This fixes it:

diff --git a/doc.go b/doc.go
index a60867f..aa128bd 100644
--- a/doc.go
+++ b/doc.go
@@ -291,9 +291,9 @@ the packet's information.  A quick example:
      err := parser.DecodeLayers(packetDat, &decoded)
      for _, layerType := range decoded {
        switch layerType {
-         case layers.LayerTypeIPv6:
-           fmt.Println("    IP4 ", ip4.SrcIP, ip4.DstIP)
          case layers.LayerTypeIPv4:
+           fmt.Println("    IP4 ", ip4.SrcIP, ip4.DstIP)
+         case layers.LayerTypeIPv6:
            fmt.Println("    IP6 ", ip6.SrcIP, ip6.DstIP)
        }
      }

Original issue reported on code.google.com by har...@typetypetype.net on 9 Nov 2014 at 10:44

GoogleCodeExporter commented 9 years ago
Fixed, thanks!

Original comment by gconnell@google.com on 11 Nov 2014 at 11:41

GoogleCodeExporter commented 9 years ago
Fixed, thanks!

Original comment by gconnell@google.com on 11 Nov 2014 at 11:41