Skip to content

Commit

Permalink
bugfix, don't ask the ipv6 interface index of a non ipv6 interface
Browse files Browse the repository at this point in the history
  • Loading branch information
tmds committed Dec 20, 2013
1 parent e5b13d8 commit c0b25c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyFileVersion("0.2.0.0")]
[assembly: AssemblyVersion("0.2.1.0")]
[assembly: AssemblyFileVersion("0.2.1.0")]
5 changes: 5 additions & 0 deletions Tmds/MDns/NetworkInterfaceHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using System.IO;
using System.Linq;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Threading;

Expand Down Expand Up @@ -222,6 +223,10 @@ private void OnReceive(IAsyncResult ar)
IPAddress address = reader.ReadARecord();
if (address.AddressFamily == AddressFamily.InterNetworkV6)
{
if (!NetworkInterface.Information.Supports(NetworkInterfaceComponent.IPv6))
{
continue;
}
address.ScopeId = NetworkInterface.Information.GetIPProperties().GetIPv6Properties().Index;
}
OnARecord(recordHeader.Name, address, recordHeader.Ttl);
Expand Down

0 comments on commit c0b25c4

Please sign in to comment.