weupnp-0.1.3-SNAPSHOT.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. diff -Bbur weupnp-0.1.3-SNAPSHOT/src/main/java/org/bitlet/weupnp/GatewayDiscover.java weupnp-0.1.3-SNAPSHOT-briar/src/main/java/org/bitlet/weupnp/GatewayDiscover.java
  2. --- weupnp-0.1.3-SNAPSHOT/src/main/java/org/bitlet/weupnp/GatewayDiscover.java 2013-05-01 21:09:27.000000000 +0100
  3. +++ weupnp-0.1.3-SNAPSHOT-briar/src/main/java/org/bitlet/weupnp/GatewayDiscover.java 2013-12-05 20:49:00.000000000 +0000
  4. @@ -253,7 +253,7 @@
  5. while (st.hasMoreTokens()) {
  6. String line = st.nextToken().trim();
  7. - if (line.isEmpty())
  8. + if (line.equals(""))
  9. continue;
  10. if (line.startsWith("HTTP/1.") || line.startsWith("NOTIFY *"))
  11. @@ -331,16 +331,6 @@
  12. // For every suitable network interface, get all IP addresses
  13. while (networkInterfaces.hasMoreElements()) {
  14. NetworkInterface card = networkInterfaces.nextElement();
  15. -
  16. - try {
  17. - // skip devices, not suitable to search gateways for
  18. - if (card.isLoopback() || card.isPointToPoint() ||
  19. - card.isVirtual() || !card.isUp())
  20. - continue;
  21. - } catch (SocketException e) {
  22. - continue;
  23. - }
  24. -
  25. Enumeration<InetAddress> addresses = card.getInetAddresses();
  26. if (addresses == null)
  27. @@ -348,6 +338,10 @@
  28. while (addresses.hasMoreElements()) {
  29. InetAddress inetAddress = addresses.nextElement();
  30. +
  31. + if (inetAddress.isLoopbackAddress())
  32. + continue;
  33. +
  34. int index = arrayIPAddress.size();
  35. if (!getIPv4 || !getIPv6) {