Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F173862487
D57093.id178760.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D57093.id178760.diff
View Options
diff --git a/usr.sbin/ctld/ctld.hh b/usr.sbin/ctld/ctld.hh
--- a/usr.sbin/ctld/ctld.hh
+++ b/usr.sbin/ctld/ctld.hh
@@ -567,13 +567,9 @@
const char *name() const { return pp_name.c_str(); }
uint32_t ctl_port() const { return pp_ctl_port; }
- bool linked() const { return pp_linked; }
- void link() { pp_linked = true; }
-
private:
std::string pp_name;
uint32_t pp_ctl_port;
- bool pp_linked = false;
};
struct kports {
diff --git a/usr.sbin/ctld/ctld.cc b/usr.sbin/ctld/ctld.cc
--- a/usr.sbin/ctld/ctld.cc
+++ b/usr.sbin/ctld/ctld.cc
@@ -1175,7 +1175,6 @@
return (false);
}
- pp->link();
return (true);
}
@@ -2641,6 +2640,7 @@
bool
conf::add_pports(struct kports &kports)
{
+ std::unordered_map<struct pport *, struct target *> linked_ports;
struct pport *pp;
int ret, i_pp, i_vp;
@@ -2654,11 +2654,13 @@
*/
pp = kports.find_port(pport);
if (pp != nullptr) {
- if (pp->linked()) {
+ const auto &pair = linked_ports.try_emplace(pp,
+ targ);
+ if (!pair.second) {
log_warnx("can't link port \"%s\" to "
- "%s, port already linked to some "
- "target", pport.c_str(),
- targ->label());
+ "%s, port already linked to %s",
+ pport.c_str(), targ->label(),
+ pair.first->second->label());
return (false);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Sep 29, 11:26 PM (18 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39904179
Default Alt Text
D57093.id178760.diff (1 KB)
Attached To
Mode
D57093: ctld: Only check physical port linking in a single configuration context
Attached
Detach File
Event Timeline
Log In to Comment