mirror of
https://github.com/xcat2/confluent.git
synced 2026-06-10 01:53:09 +00:00
Have apiclient and copernicus try port 1900, but accept if they cannot.
This commit is contained in:
@@ -160,11 +160,17 @@ def scan_confluents(confuuid=None):
|
||||
s6 = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
|
||||
s6.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 1)
|
||||
s6.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
|
||||
s6.bind(('::', 1900))
|
||||
try: # We would like to bind for firewall rules, however if not possible then leave it alone
|
||||
s6.bind(('::', 1900))
|
||||
except Exception:
|
||||
pass
|
||||
s4 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
s4.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
|
||||
s4.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
|
||||
s4.bind(('0.0.0.0', 1900))
|
||||
try:
|
||||
s4.bind(('0.0.0.0', 1900))
|
||||
except Exception:
|
||||
pass
|
||||
doneidxs = set([])
|
||||
msg = 'M-SEARCH * HTTP/1.1\r\nST: urn:xcat.org:service:confluent:'
|
||||
if not confuuid and os.path.exists('/etc/confluent/confluent.deploycfg'):
|
||||
|
||||
@@ -121,10 +121,10 @@ int main(int argc, char* argv[]) {
|
||||
memset(last6msg, 0, 1024);
|
||||
addr.sin6_family = AF_INET6;
|
||||
addr.sin6_addr = in6addr_any;
|
||||
addr.sin6_port = htons(190);
|
||||
addr.sin6_port = htons(1900); // Attempt to be consistent about source port for firewall
|
||||
addr4.sin_family = AF_INET;
|
||||
addr4.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
addr4.sin_port = htons(190);
|
||||
addr4.sin_port = htons(1900);
|
||||
dst.sin6_family = AF_INET6;
|
||||
dst.sin6_port = htons(1900);
|
||||
inet_pton(AF_INET6, "ff02::c", &dst.sin6_addr);
|
||||
@@ -160,14 +160,14 @@ int main(int argc, char* argv[]) {
|
||||
if (setsockopt(ns, IPPROTO_IPV6, IPV6_V6ONLY, &ifidx, sizeof(ifidx)) != 0) {
|
||||
fprintf(stderr, "Unable to limit socket to IPv6 only\n");
|
||||
}
|
||||
/* For now, bind to 190 to prove we are a privileged process */
|
||||
/* For now, bind to 1900 to prove we are a privileged process */
|
||||
if (bind(n4, (const struct sockaddr *)&addr4, sizeof(addr4)) < 0) {
|
||||
fprintf(stderr, "Error binding privilged port!\n");
|
||||
exit(1);
|
||||
//fprintf(stderr, "Error binding privilged port!\n");
|
||||
//exit(1);
|
||||
}
|
||||
if (bind(ns, (const struct sockaddr *)&addr, sizeof(addr)) < 0) {
|
||||
fprintf(stderr, "Error binding ipv6 privileged port!\n");
|
||||
exit(1);
|
||||
//fprintf(stderr, "Error binding ipv6 privileged port!\n");
|
||||
//exit(1);
|
||||
}
|
||||
getifaddrs(&ifa);
|
||||
for (ifc = ifa; ifc != NULL; ifc = ifc->ifa_next) {
|
||||
|
||||
Reference in New Issue
Block a user