<rdar://problem/6434656> Sleep Proxy: Put owner OPT records in multicast announcement...
authorcheshire@apple.com <cheshire@apple.com@214c2c4a-bf3b-4dcf-9390-e4dd3010487d>
Wed, 2 Sep 2009 01:01:16 +0000 (01:01 +0000)
committercheshire@apple.com <cheshire@apple.com@214c2c4a-bf3b-4dcf-9390-e4dd3010487d>
Wed, 2 Sep 2009 01:01:16 +0000 (01:01 +0000)
commit4a7566fa9e102ed14f35d7a0456cebcf4ea12c7e
treea24f46ed04f44dd0ddb489dd8c672f571d123690
parentf1911f18fe641d69e5f9270a334a721e073bc1bf
<rdar://problem/6434656> Sleep Proxy: Put owner OPT records in multicast announcements to avoid conflicts
Fixed incorrect calculation of OwnerRecordSpace.
Because of missing parentheses, and '+' binding tighter than '?:', the expression:
 DNSOpt_Header_Space +  mDNSSameEthAddress(&m->PrimaryMAC, &intf->MAC)  ? DNSOpt_OwnerData_ID_Space : DNSOpt_OwnerData_ID_Wake_Space
evaluated as
(DNSOpt_Header_Space +  mDNSSameEthAddress(&m->PrimaryMAC, &intf->MAC)) ? DNSOpt_OwnerData_ID_Space : DNSOpt_OwnerData_ID_Wake_Space
instead of
 DNSOpt_Header_Space + (mDNSSameEthAddress(&m->PrimaryMAC, &intf->MAC)  ? DNSOpt_OwnerData_ID_Space : DNSOpt_OwnerData_ID_Wake_Space)
This made the result *always* DNSOpt_OwnerData_ID_Space, when it should have been one of
(DNSOpt_Header_Space + DNSOpt_OwnerData_ID_Space) or
(DNSOpt_Header_Space + DNSOpt_OwnerData_ID_Wake_Space)

git-svn-id: http://svn.macosforge.org/repository/mDNSResponder/trunk@6640 214c2c4a-bf3b-4dcf-9390-e4dd3010487d
mDNSCore/mDNS.c
mDNSCore/mDNSEmbeddedAPI.h