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

Implement Default for tcp4::ConfigData #50

Merged
merged 1 commit into from Aug 18, 2022
Merged

Conversation

Ayush1325
Copy link
Contributor

Passing unint data to EFI_TCP4_PROTOCOL.GetModeData() causes UB.
Passing MaybeUnint::zeroed() works fine though.

Not sure if this is the intended behavior or a bug in OVMF.

Signed-off-by: Ayush ayushsingh1325@gmail.com

Passing unint data to `EFI_TCP4_PROTOCOL.GetModeData()` causes UB.
Passing `MaybeUnint::zeroed()` works fine though.

Signed-off-by: Ayush <ayushsingh1325@gmail.com>
Comment on lines 457 to 461
#[repr(C)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, Default)]
pub struct Ipv4Address {
pub addr: [u8; 4],
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::net::Ipv4Addr does not implement Default. Do you happen to know why? I think INADDR_ANY / all-zero is a suitable default, so I am fine with this. I just wondered why std does not have this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that now as well. I would have expected the default to be UNSPECIFIED.

@dvdhrm dvdhrm merged commit 50133d2 into r-efi:main Aug 18, 2022
@Ayush1325 Ayush1325 deleted the tcp_fix branch October 11, 2022 11:20
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