From 3f7c03a23e097f69b716ea79a79848e5ba0a4303 Mon Sep 17 00:00:00 2001 From: James Yonan Date: Mon, 14 Feb 2011 05:20:23 +0000 Subject: Fixes to r6925. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@6927 e7ae566f-a301-0410-adde-c780ea21d3b5 --- route.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/route.c b/route.c index 711f7f9..c3e4acf 100644 --- a/route.c +++ b/route.c @@ -1800,7 +1800,7 @@ struct rtmsg { }; #define ROUNDUP(a) \ - ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) + ((a) > 0 ? (1 + (((a) - 1) | (sizeof(uint32_t) - 1))) : sizeof(uint32_t)) static bool get_default_gateway_ex (in_addr_t *ret, in_addr_t *netmask, char **ifname) @@ -2359,7 +2359,7 @@ get_default_gateway_mac_addr (unsigned char *macaddr) goto done; } - buffer = (char *) gc_malloc (bufsize, false, &gc); + buffer = (char *) gc_malloc (bufsize, true, &gc); sockfd = socket(AF_INET, SOCK_DGRAM, 0); if (sockfd < 0) @@ -2377,7 +2377,7 @@ get_default_gateway_mac_addr (unsigned char *macaddr) goto done; } - for (cp = buffer; cp < buffer + bufsize; ) + for (cp = buffer; cp <= buffer + bufsize - sizeof(struct ifreq); ) { ifr = (struct ifreq *)cp; if (ifr->ifr_addr.sa_family == AF_LINK && !strncmp(ifr->ifr_name, ifname, IFNAMSIZ)) -- cgit v1.2.3