Skip to content

BGPKeepAlive generates 38-byte packets instead of RFC 4271-required 19 bytes #4933

@shadimotaali

Description

@shadimotaali

Brief description

The BGPKeepAlive class uses multiple inheritance from both BGP and BGPHeader, combined with the existing bind_layers(BGPHeader, BGPKeepAlive, {"type": 4}) binding. This causes a duplicate header to be appended at packet build time, resulting in 38-byte KEEPALIVE packets instead of the 19 octets required by RFC 4271:

"A KEEPALIVE message consists of only the message header and has a length of 19 octets."

Scapy version

2.4.5

Python version

3.8

Operating system

Linux 5.10.46

Additional environment information

No response

How to reproduce

To reproduce: build a BGPKeepAlive() packet and inspect its length via len(BGPKeepAlive()).
Workaround: instantiating BGPKeepAlive() directly without layering it on BGPHeader produces a compliant 19-byte packet. This has been validated against GNS3 simulations with Cisco IOS routers and real Cisco BGP traces.

Actual result

No response

Expected result

No response

Related resources

No response

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