-
Notifications
You must be signed in to change notification settings - Fork 400
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(fcoe-uefi): exit early on empty vlan #2379
base: master
Are you sure you want to change the base?
Conversation
I have tested the snippet, but I'm unable to test in dracut, as I lack the HW / setup. |
CC @mwilck |
This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions. |
The code in question is obviously broken. But the fix is broken, too. Instead of combining several @LaszloGombos, sorry I saw this too late. Please reopen. I have no permission to do this. |
@pvalena, could you update the PR as indicated above? |
Will do. Not sure why I didn't cover it in the |
@mwilck PTAL. |
Thanks! Can you elmininate the |
Sure thing... this should have identical behaviour. |
@pvalena please check the lint error. Thanks ! |
Just |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can get_fcoe_boot_vlan
return 1
dracut/modules.d/99uefi-lib/uefi-lib.sh
Lines 141 to 144 in 6acfeca
while :; do | |
type=$(getbyte) || return 1 | |
subtype=$(getbyte) || return 1 | |
len=$(getword) || return 1 |
after printing some value?
dracut/modules.d/99uefi-lib/uefi-lib.sh
Lines 147 to 150 in 6acfeca
0314) | |
# VLAN | |
printf "%d" "$(getword)" | |
;; |
i.e., in the next loop iteration. If the answer is "no", the patch is ok.
@aafeijoo-suse, I don't understand the question. Neither the current code nor the patched code check the return value of I can't see that Pavel's patch would cause a regression. If your intention is to improve this code further, you might as well stumble upon the |
I just read what he tries to solve in the commit message: "Exit early in case get_fcoe_boot_vlan exits with error or just an empty string". |
I guess we could write
I feel uncomfortable wrt the return value of assignments in general, but this should work. @aafeijoo-suse, would you be fine with that? |
Sure. Or just changing the commit message would be enough :) |
@pvalena would you change the code as indicated above? |
Sure, let's enhance it further. Sorry about the forgotten commit message :) will clear things up. |
Exit early in case get_fcoe_boot_vlan exits with error or just an empty string, instead of producing invalid config entry.
Rebased, fixed as suggested. Sorry it has taken so long :). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased, fixed as suggested. Sorry it has taken so long :).
No problem, it would have been enough to amend the commit message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Exit early in case get_fcoe_boot_vlan exits with error or just an empty string, instead of producing invalid config entry. (Cherry-picked commit: 45fc8df1cf3fdf9726efda4d26c7cccb9e6aedd2 PR: dracutdevs/dracut#2379) Resolves: RHEL-14251
Exit early in case get_fcoe_boot_vlan exits with error or just an empty string, instead of producing invalid config entry. (Cherry-picked commit: 45fc8df1cf3fdf9726efda4d26c7cccb9e6aedd2 PR: dracutdevs/dracut#2379) Resolves: RHEL-14251
Exit early in case
get_fcoe_boot_vlan
exits with error or just an empty string, instead of producing invalid config entry.Changes
Just handling a corner-case when vlan is empty; this should skip to another vlan if present.
Checklist