Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: arp unmarshal #68

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jesson1
Copy link

@jesson1 jesson1 commented Jan 13, 2025

Fix the ARP packet parsing code to adapt to the scenario where the switch adds extra padding bytes to ARP packets to meet the 64-byte minimum frame size.

Error stack:

panic: runtime error: slice bounds out of range [4:0]
goroutine 1127 [running]:
third_party/libOpenflow/openflow13.(*PacketIn2PropPacket).UnmarshalBinary(0xc0000f7a40, {0xc0012fe840, 0x58, 0x7c0})
        /third_party/libOpenflow/openflow13/nxt_message.go:807 +0x17a
third_party/libOpenflow/openflow13.DecodePacketIn2Prop({0xc0012fe840?, 0x58?, 0x7c0?})
        /third_party/libOpenflow/openflow13/nxt_message.go:1201 +0x1f1
third_party/libOpenflow/openflow13.(*PacketIn2).UnmarshalBinary(0xc0006b4678, {0xc0012fe810, 0x88, 0x7f0})
        /third_party/libOpenflow/openflow13/nxt_message.go:1240 +0xa5
third_party/libOpenflow/openflow13.decodeVendorData(0x40de87?, {0xc0012fe810, 0x88, 0x7f0})
        /third_party/libOpenflow/openflow13/nxt_message.go:1326 +0x1a2
third_party/libOpenflow/openflow13.(*VendorHeader).UnmarshalBinary(0xc000cf3080, {0xc0012fe800?, 0x4148c5?, 0x0?})
        /third_party/libOpenflow/openflow13/openflow13.go:841 +0xd0
third_party/libOpenflow/openflow13.Parse({0xc0012fe800, 0x98, 0x800})
        /third_party/libOpenflow/openflow13/openflow13.go:127 +0x230
third_party/ofnet/ofctrl.(*Controller).Parse(0xc0016c2f70?, {0xc0012fe800?, 0x0?, 0x0?})
        /third_party/ofnet/ofctrl/ofctrl.go:228 +0x3c
third_party/libOpenflow/util.(*streamWorker).parse(0xc00096c570, 0xc00132e000, {0x20c8e80, 0xc000a0eed0}, 0x0?, 0x0?)
        /third_party/libOpenflow/util/stream.go:41 +0x163
created by third_party/libOpenflow/util.NewMessageStream
        /third_party/libOpenflow/util/stream.go:98 +0x319

…he switch adds extra padding bytes to ARP packets to meet the 64-byte minimum frame size.

Signed-off-by: jiasheng.yu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant