Ticket #587: route.c.2.patch
File route.c.2.patch, 1.6 KB (added by , 9 years ago) |
---|
-
route.c
old new 2644 2644 seq = 0; 2645 2645 rtm_addrs = RTA_DST | RTA_NETMASK; 2646 2646 2647 bzero(&so_dst, sizeof(so_dst));2648 bzero(&so_mask, sizeof(so_mask));2649 bzero(&rtm, sizeof(struct rt_msghdr));2647 memset(&so_dst, 0, sizeof(so_dst)); 2648 memset(&so_mask, 0, sizeof(so_mask)); 2649 memset(&rtm, 0, sizeof(struct rt_msghdr)); 2650 2650 2651 2651 rtm.rtm_type = RTM_GET; 2652 2652 rtm.rtm_flags = RTF_UP | RTF_GATEWAY; … … 2665 2665 rtm.rtm_msglen = l = cp - (char *)&m_rtmsg; 2666 2666 2667 2667 s = socket(PF_ROUTE, SOCK_RAW, 0); 2668 if (s < 0) 2669 { 2670 msg(M_WARN|M_ERRNO, "Unable to open default gateway from route socket:"); 2671 gc_free (&gc); 2672 close(s); 2673 return; 2674 } 2668 2675 2669 2676 if (write(s, (char *)&m_rtmsg, l) < 0) 2670 2677 { … … 2758 2765 seq = 0; 2759 2766 rtm_addrs = RTA_DST | RTA_NETMASK | RTA_IFP; 2760 2767 2761 bzero(&m_rtmsg, sizeof(m_rtmsg));2762 bzero(&so_dst, sizeof(so_dst));2763 bzero(&so_mask, sizeof(so_mask));2764 bzero(&rtm, sizeof(struct rt_msghdr));2768 memset(&m_rtmsg, 0, sizeof(m_rtmsg)); 2769 memset(&so_dst, 0, sizeof(so_dst)); 2770 memset(&so_mask, 0, sizeof(so_mask)); 2771 memset(&rtm, 0, sizeof(struct rt_msghdr)); 2765 2772 2766 2773 rtm.rtm_type = RTM_GET; 2767 2774 rtm.rtm_flags = RTF_UP | RTF_GATEWAY; … … 2965 2972 seq = 0; 2966 2973 rtm_addrs = RTA_DST | RTA_NETMASK; 2967 2974 2968 bzero(&so_dst, sizeof(so_dst));2969 bzero(&so_mask, sizeof(so_mask));2970 bzero(&rtm, sizeof(struct rt_msghdr));2975 memset(&so_dat, 0, sizeof(so_dat)); 2976 memset(&so_mask, 0, sizeof(so_mask)); 2977 memset(&rtm, 0, sizeof(struct rt_msghdr)); 2971 2978 2972 2979 rtm.rtm_type = RTM_GET; 2973 2980 rtm.rtm_flags = RTF_UP | RTF_GATEWAY;