UPnP: IPv6 part 6

IP mismatch detction fix take 2
Fix set of SSU comm states used for requiring address confirmation
This commit is contained in:
zzz
2021-02-28 11:34:28 -05:00
parent 12e9e79010
commit aa91dc985d
2 changed files with 10 additions and 5 deletions

View File

@ -280,10 +280,15 @@ public class UPnP extends ControlPoint implements DeviceChangeListener, EventLis
if (pkt != null) {
String pktIP = pkt.getRemoteAddress();
if (!stringEquals(ip, pktIP)) {
ignore = true;
if (_log.shouldWarn())
_log.warn("Ignoring UPnP with IP mismatch: " + name + " UDN: " + udn +
" dev IP " + ip + " pkt IP: " + pktIP);
// IPv6 location received over IPv4 is ok, or vice versa
boolean v61 = ip.contains(":");
boolean v62 = pktIP.contains(":");
if (v61 == v62) {
ignore = true;
if (_log.shouldWarn())
_log.warn("Ignoring UPnP with IP mismatch: " + name + " UDN: " + udn +
" dev IP " + ip + " pkt IP: " + pktIP);
}
}
}
}

View File

@ -248,7 +248,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
Status.REJECT_UNSOLICITED,
Status.IPV4_FIREWALLED_IPV6_OK,
Status.IPV4_SNAT_IPV6_OK,
Status.IPV4_OK_IPV6_FIREWALLED);
Status.IPV4_FIREWALLED_IPV6_UNKNOWN);
private static final Set<Status> STATUS_IPV6_FW = EnumSet.of(Status.IPV4_OK_IPV6_FIREWALLED,
Status.IPV4_UNKNOWN_IPV6_FIREWALLED,