[TR064] Fix pattern excluding some valid ip-addresses (#13894)

* Improve logging and adjusted timeout
* Fix wanBlockIPs regex

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
This commit is contained in:
lsiepel 2022-12-10 08:48:33 +01:00 committed by GitHub
parent 61b5c26b58
commit b9f092fdb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -226,13 +226,15 @@ public class SOAPValueConverter {
@SuppressWarnings("unused")
private State processTamListURL(State state, Tr064ChannelConfig channelConfig) throws PostProcessingException {
try {
ContentResponse response = httpClient.newRequest(state.toString()).timeout(1000, TimeUnit.MILLISECONDS)
ContentResponse response = httpClient.newRequest(state.toString()).timeout(1500, TimeUnit.MILLISECONDS)
.send();
String responseContent = response.getContentAsString();
int messageCount = responseContent.split("<New>1</New>").length - 1;
return new DecimalType(messageCount);
} catch (InterruptedException | TimeoutException | ExecutionException e) {
} catch (TimeoutException e) {
throw new PostProcessingException("Failed to get TAM list due to time out from URL " + state.toString(), e);
} catch (InterruptedException | ExecutionException e) {
throw new PostProcessingException("Failed to get TAM list from URL " + state.toString(), e);
}
}

View File

@ -65,7 +65,7 @@
serviceId="urn:X_AVM-DE_HostFilter-com:serviceId:X_AVM-DE_HostFilter1"/>
<getAction name="GetWANAccessByIP" argument="NewDisallow">
<parameter name="NewIPv4Address" thingParameter="wanBlockIPs"
pattern="([1-9]\d{0,2}\.){3}[1-9]\d{0,2}(\s*#.*)*"/>
pattern="^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$"/>
</getAction>
<setAction name="DisallowWANAccessByIP" argument="NewDisallow">
<parameter name="NewIPv4Address" thingParameter="wanBlockIPs"/>