FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

CLOUDSTACK-8749: KVM - cleanup linklocal interface based on names by yadvr · Pull Request #718 · apache/cloudstack · GitHub

Repository navigation

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ private void deleteExitingLinkLocalRouteTable(String linkLocalBr) {
for (String line : lines) {
String[] tokens = line.split(" ");
if (!tokens[2].equalsIgnoreCase(linkLocalBr)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I am concerned about the unchecked array access in the event of malformed/unexpected input. Consider the following as a bit of extra safety in the event of malformed input beginning at line 289:

if (tokens != null && tokens.length < 2) {
   // Should we emit a log warning here to indicate that we received an unexpected string format?
   continue;
}

final String device = tokens[2];
if (!Strings.isNullOrEmpty(device) &&
    !device.equalsIgnoreCase(linkLocalBr)) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

For this PR we cannot make any changes now that it is merged already; perhaps send a new PR or I can pick it up later.

Script.runSimpleBashScript("ip route del " + NetUtils.getLinkLocalCIDR());
Script.runSimpleBashScript("ip route del " + NetUtils.getLinkLocalCIDR() + " dev " + tokens[2]);
} else {
foundLinkLocalBr = true;
}
Expand Down

Back | FazBrowse Home | New Git URL