Skip to content

[BUG] send_packet_out() can cause a segmentation fault if used in a transparent service #212

@DavideAG

Description

@DavideAG

Describe the bug

send_packet_out () can cause a segmentation fault if used in a transparent service if the parent does not exist

To Reproduce

Use the tutorial 1 configuration (https://polycube.readthedocs.io/en/latest/tutorials/tutorial1/tutorial1.html)

  1. create a new transparent service that uses send_packet_out
  2. attach it to veth1
  3. execute a ping
  4. segmentation fault

Expected behavior

the service should indicate that the parent does not exist

Please tell us about your environment:

  1. OS details: Ubuntu 18.04
  2. Kernel details: 5.15.0-55-generic
  3. Polycube Version: 0.1.0-beta+
  4. Polycube Log: "Segmentation Fault"

Additional context

you need to check if the father exists.
Like

logger->warn("packetout: port {0}:{1} is down", parent_.get_name(), name_);

The error is here:

Port *parent = dynamic_cast<Port *>(parent_);

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions