-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 --interface-id and improve minmdns address policy #37360
base: master
Are you sure you want to change the base?
Changes from all commits
a433a59
30e4475
1802328
b1f4fa8
afa9cc2
5eb60c6
05cc5a4
d81d570
086bc71
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,13 +16,20 @@ import("//build_overrides/chip.gni") | |
import("${chip_root}/src/access/access.gni") | ||
import("${chip_root}/src/app/common_flags.gni") | ||
import("${chip_root}/src/app/icd/icd.gni") | ||
import("${chip_root}/src/platform/device.gni") | ||
|
||
config("server_config") { | ||
defines = [] | ||
|
||
if (chip_app_use_echo) { | ||
defines += [ "CHIP_APP_USE_ECHO" ] | ||
} | ||
|
||
if (chip_mdns_minimal) { | ||
defines += [ "CHIP_MDNS_MINIMAL=1" ] | ||
} else { | ||
defines += [ "CHIP_MDNS_MINIMAL=0" ] | ||
} | ||
} | ||
|
||
source_set("terms_and_conditions") { | ||
|
@@ -85,6 +92,11 @@ static_library("server") { | |
"${chip_root}/src/transport", | ||
] | ||
|
||
if (chip_mdns_minimal) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we have mdns as minimal or platform ... so this may pull a mdns dependency even for thread (at least CI link errors seem to indicate that). |
||
public_deps += | ||
[ "${chip_root}/src/lib/dnssd/minimal_mdns:singleinterface_policy" ] | ||
} | ||
|
||
if (chip_terms_and_conditions_required) { | ||
public_deps += [ ":terms_and_conditions" ] | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,9 +51,6 @@ + (NSTask *)doStartAppWithName:(NSString *)name arguments:(NSArray<NSString *> * | |
__auto_type * appTask = [self createTaskForPath:executable]; | ||
|
||
__auto_type * forcedArguments = @[ | ||
// Make sure we only advertise on the local interface. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, this is going to break the Darwin tests, causing a lot of random failures due to cross-talk between runners. Stopping here. |
||
@"--interface-id", | ||
@"-1", | ||
@"--secured-device-port", | ||
[NSString stringWithFormat:@"%u", kBasePort + discriminator.unsignedShortValue], | ||
@"--discriminator", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,9 +25,22 @@ namespace { | |
AddressPolicy * gAddressPolicy = nullptr; | ||
} // namespace | ||
|
||
// This will be resolved at link time if a default policy is set | ||
#ifndef CHIP_MINMDNS_NONE_POLICY | ||
AddressPolicy * GetDefaultAddressPolicy(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should go in some header rather than declared here and then in other per-policy headers in a repeated manner. We want to ensure a single declaration placement. Probably in |
||
#endif | ||
|
||
AddressPolicy * GetAddressPolicy() | ||
{ | ||
VerifyOrDie(gAddressPolicy != nullptr); | ||
#ifndef CHIP_MINMDNS_NONE_POLICY | ||
// The GetDefaultAddressPolicy() function should be defined by a compile-defined default policy. | ||
if (gAddressPolicy == nullptr) | ||
{ | ||
auto p = GetDefaultAddressPolicy(); | ||
VerifyOrDie(p != nullptr); | ||
SetAddressPolicy(p); | ||
} | ||
#endif | ||
return gAddressPolicy; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,10 +16,12 @@ | |
*/ | ||
#pragma once | ||
|
||
#include <lib/dnssd/minimal_mdns/AddressPolicy.h> | ||
|
||
namespace mdns { | ||
namespace Minimal { | ||
|
||
void SetDefaultAddressPolicy(); | ||
AddressPolicy * GetDefaultAddressPolicy(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should probably be removed from here. Likely we may not need this header at all. |
||
|
||
} // namespace Minimal | ||
} // namespace mdns |
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.
Isn't this going to break running YAML tests on Darwin, by no longer passing that argument?