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

Allocate 6 bytes to copy MAC addresses when unmarshalling ethernet match fields #30

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

Conversation

rojkov
Copy link

@rojkov rojkov commented Nov 16, 2022

Currently we are trying to unmarshal data to an uninitialized struct whose net.HardwareAddr fields are set to nil. In this case the copy() function silently does nothing.

Initialize the fields to slices of bytes of length 6 before copying data to them.

Signed-off-by: Dmitry Rozhkov dmitry.rojkov@gmail.com

…tch fields

Currently we are trying to unmarshal data to an uninitialized struct whose
net.HardwareAddr fields are set to nil. In this case the copy() function
silently does nothing.

Initialize the fields to slices of bytes of length 6 before
copying data to them.

Signed-off-by: Dmitry Rozhkov <dmitry.rojkov@gmail.com>
@wenyingd
Copy link

Hi @rojkov thanks for working on this patch. I have one comment on this patch:

OpenFlow 1.5 is the major version we planned to support for a long time ( OpenFlow1.3 is deprecated ), so please also change the code in path openflow15/match.go if necessary.

shi0rik0 added a commit to shi0rik0/libOpenflow that referenced this pull request Jul 11, 2023
…tch fields

Currently we are trying to unmarshal data to an uninitialized struct whose
net.HardwareAddr fields are set to nil. In this case the copy() function
silently does nothing.

Initialize the fields to slices of bytes of length 6 before copying data to them.

This commit is derived from antrea-io#30.

Signed-off-by: shi0rik0 <anguuan@outlook.com>
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.

None yet

2 participants