ravahn / machina

Network capture library for realtime TCP/IP decoding from a windows application. Includes an extension library to support FFXIV data capture.
GNU General Public License v3.0
212 stars 78 forks source link

RawPCap_GetDataTwiceTest() failed if some network interface is down #2

Closed Noisyfox closed 6 years ago

Noisyfox commented 6 years ago

https://github.com/ravahn/machina/blob/9d648aa1d1174953fc44bad0e8471d28de8667bb/Machina.Tests/RawPCapTests.cs#L42

Will pick up the ip from an interface which is down then cause a null pointer ex at:

https://github.com/ravahn/machina/blob/9d648aa1d1174953fc44bad0e8471d28de8667bb/Machina/RawPCap.cs#L211

Noisyfox commented 6 years ago

This also affect the test RawSocket_GetDataTwiceTest() at https://github.com/ravahn/machina/blob/9d648aa1d1174953fc44bad0e8471d28de8667bb/Machina/RawSocket.cs#L67

ravahn commented 6 years ago

thanks, I can fix that.

ravahn commented 6 years ago

Updated for 2.0.1 - the fix is to only include interfaces with status = Up in GetNetworkInterfaceIPs(). Let me know if it solved the problem for you.

Noisyfox commented 6 years ago

Cool~ It works now~