Skip to content

Commit

Permalink
Remove hostfwd if no adb/fastboot port specified in config file
Browse files Browse the repository at this point in the history
Remove hostfwd if no adb/fastboot port specified in config file

Tracked-On: OAM-102312
Signed-off-by: Yadong Qi <yadong.qi@intel.com>
  • Loading branch information
YadongQi authored and sysopenci committed May 30, 2022
1 parent 2c822b8 commit 3d85e9d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/guest/start.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,11 +710,11 @@ static void setup_vnet(GKeyFile *gkf, char **p, size_t *size) {
if (val && val1) {
cx = snprintf(buf, bs, " -netdev user,id=net0,hostfwd=tcp::%s-:5555,hostfwd=tcp::%s-:5554", val, val1);
} else if (val) {
cx = snprintf(buf, bs, " -netdev user,id=net0,hostfwd=tcp::%s-:5555,hostfwd=tcp::5554-:5554", val);
cx = snprintf(buf, bs, " -netdev user,id=net0,hostfwd=tcp::%s-:5555", val);
} else if (val1) {
cx = snprintf(buf, bs, " -netdev user,id=net0,hostfwd=tcp::5555-:5555,hostfwd=tcp::%s-:5554", val1);
cx = snprintf(buf, bs, " -netdev user,id=net0,hostfwd=tcp::%s-:5554", val1);
} else {
cx = snprintf(buf, bs, " -netdev user,id=net0,hostfwd=tcp::5555-:5555,hostfwd=tcp::5554-:5554");
cx = snprintf(buf, bs, " -netdev user,id=net0");
}

if (cx < 0 || cx >= bs)
Expand Down

0 comments on commit 3d85e9d

Please sign in to comment.