()
| 509 | return nil |
| 510 | } |
| 511 | func (p *lazyPacket) decodeNextLayer() { |
| 512 | if p.next == nil { |
| 513 | return |
| 514 | } |
| 515 | d := p.data |
| 516 | if p.last != nil { |
| 517 | d = p.last.LayerPayload() |
| 518 | } |
| 519 | next := p.next |
| 520 | p.next = nil |
| 521 | // We've just set p.next to nil, so if we see we have no data, this should be |
| 522 | // the final call we get to decodeNextLayer if we return here. |
| 523 | if len(d) == 0 { |
| 524 | return |
| 525 | } |
| 526 | defer p.recoverDecodeError() |
| 527 | err := next.Decode(d, p) |
| 528 | if err != nil { |
| 529 | p.addFinalDecodeError(err, nil) |
| 530 | } |
| 531 | } |
| 532 | func (p *lazyPacket) LinkLayer() LinkLayer { |
| 533 | for p.link == nil && p.next != nil { |
| 534 | p.decodeNextLayer() |
no test coverage detected