Browse code

Repair "tap server" mode brokenness caused by <stdbool.h> fallout

Operator/Cast precedence wrong: casting mac[0] to (bool) first - giving
"1" for "any mac address that does not start with 00:" - and only then
bit-anding with "1" - thus always returning "true". Which, in turn,
leads to "reject all incoming packets with 'bad source address'".

OpenVPN bug #216.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Fabian Knittel <fabian.knittel@lettink.de>
Message-Id: 1341089443-2287-1-git-send-email-gert@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/6817
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>

Gert Doering authored on 2012/07/01 05:50:43
Showing 1 changed files
... ...
@@ -52,7 +52,7 @@ mroute_addr_init (struct mroute_addr *addr)
52 52
 static inline bool
53 53
 is_mac_mcast_addr (const uint8_t *mac)
54 54
 {
55
-  return (bool) mac[0] & 1;
55
+  return (bool) (mac[0] & 1);
56 56
 }
57 57
 
58 58
 static inline bool