Commit 37d8be12 authored by 赵啸非's avatar 赵啸非

修改pom文件

parent c7bffb9b
...@@ -41,8 +41,8 @@ public class CaptureStartedService implements IApplicationStartedService { ...@@ -41,8 +41,8 @@ public class CaptureStartedService implements IApplicationStartedService {
List<PcapNetworkInterface> allDevs = null; List<PcapNetworkInterface> allDevs = null;
try { try {
allDevs = Pcaps.findAllDevs(); allDevs = Pcaps.findAllDevs();
for (final PcapNetworkInterface device : allDevs) {
String localHost = "127.0.0.1"; String localHost = "127.0.0.1";
for (final PcapNetworkInterface device : allDevs) {
List<PcapAddress> addresses = device.getAddresses(); List<PcapAddress> addresses = device.getAddresses();
Boolean bool = false; Boolean bool = false;
String ip = ""; String ip = "";
...@@ -55,13 +55,9 @@ public class CaptureStartedService implements IApplicationStartedService { ...@@ -55,13 +55,9 @@ public class CaptureStartedService implements IApplicationStartedService {
ipv4 = Validator.isIpv4(ip); ipv4 = Validator.isIpv4(ip);
log.info("ip:{}, is ipv4:{}", ip, ipv4); log.info("ip:{}, is ipv4:{}", ip, ipv4);
if (ip != null && ip.contains(localHost)) { if (ip != null && ip.contains(localHost)) {
bool = false; continue;
break;
// 返回指定的设备对象
//return networkInterface;
} }
if (!ipv4) { if (ipv4) {
bool = true; bool = true;
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment