Skip to content

[enhancement] Enable clear_cache() to spread upward in the packet tree #4707

Closed

Description

@alxroyer-thales

Enable clear_cache() to spread upward in the packet tree (underlayer and parent packets),
and not downward as currently (fields and payload).

Activity

  1. alxroyer-thales commented on Mar 28, 2025

    @alxroyer-thales
    Author

    Provides a straight forward implementation for #4706.

    Also improves performance in case of large packet trees with many packet fields (see #4705).

  2. alxroyer-thales commented on Mar 28, 2025

    @alxroyer-thales
    Author

    Successfully implemented in a Scapy wrapper.

    I'll provide a PR soon to propose the integration of it directly in Scapy implementation.

  3. gpotter2 commented on Apr 6, 2025

    @gpotter2
    Member

    Hm. Thanks for the suggestion. A bit unsure, but it feels like a pretty decent idea to me. I agree that the current behavior of caching can be hard to grasp.

    @p-l- @guedou What do you think?

  4. alxroyer-thales commented on Apr 7, 2025

    @alxroyer-thales
    Author

    In order to ensure both 1) improve performance, and 2) avoid breaking the API, we could add parameters to clear_cache() to provide both behaviours:

  5. gpotter2 commented on May 29, 2025

    @gpotter2
    Member

    Thinking about this, I feel like it could be achieved by just doing pkt.firstlayer().clear_cache(). Unsure there's a real use case, considering that building the parent layer already properly rebuilds everything if the child layer has been changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions