[Mono-dev] Zeroconf Patch

Frank Cohen frankenspank at gmail.com
Mon Apr 12 07:27:14 EDT 2010


I've attached a patch for a bug found in Bonjour Provider in the  ZeroConf
library. The problem was when registering a service, the port was always  0
no matter what value was provided.  To fix this, I changed the cast in the
setter below from an int to a int16 to stop the overflow that happened
there.

//Modifed Code:
        public ushort UPort
        {
            get {
                return (ushort)IPAddress.NetworkToHostOrder((int)port);
            }
            set
            {
                port =
Convert.ToUInt16(IPAddress.HostToNetworkOrder((Int16)value));
            }
        }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100412/803522d7/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Service.cs
Type: application/octet-stream
Size: 4288 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100412/803522d7/attachment.obj 


More information about the Mono-devel-list mailing list