Ticket #587: route.c.2.patch

File route.c.2.patch, 1.6 KB (added by dogbert2, 6 years ago)

Patch file for ticket #587

  • route.c

    old new  
    26442644  seq = 0;
    26452645  rtm_addrs = RTA_DST | RTA_NETMASK;
    26462646
    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));
    26502650
    26512651  rtm.rtm_type = RTM_GET;
    26522652  rtm.rtm_flags = RTF_UP | RTF_GATEWAY;
     
    26652665  rtm.rtm_msglen = l = cp - (char *)&m_rtmsg;
    26662666
    26672667  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    }
    26682675
    26692676  if (write(s, (char *)&m_rtmsg, l) < 0)
    26702677    {
     
    27582765  seq = 0;
    27592766  rtm_addrs = RTA_DST | RTA_NETMASK | RTA_IFP;
    27602767
    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));
    27652772
    27662773  rtm.rtm_type = RTM_GET;
    27672774  rtm.rtm_flags = RTF_UP | RTF_GATEWAY;
     
    29652972  seq = 0;
    29662973  rtm_addrs = RTA_DST | RTA_NETMASK;
    29672974
    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));
    29712978
    29722979  rtm.rtm_type = RTM_GET;
    29732980  rtm.rtm_flags = RTF_UP | RTF_GATEWAY;