source: trunk/package/busybox/patches/460-truncated_ping_results.patch @ 14590

Last change on this file since 14590 was 14590, checked in by hauke, 8 years ago

busybox: refresh busybox patches

File size: 1.4 KB
  • networking/ping.c

    a b static void ping4(len_and_sockaddr *lsa) 
    9191        struct sockaddr_in pingaddr; 
    9292        struct icmp *pkt; 
    9393        int pingsock, c; 
    94         char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN]; 
     94        char packet[datalen + ICMP_MINLEN + MAXIPLEN + MAXICMPLEN]; 
    9595 
    9696        pingsock = create_icmp_socket(); 
    9797        pingaddr = lsa->u.sin; 
    static void ping4(len_and_sockaddr *lsa) 
    101101        pkt->icmp_type = ICMP_ECHO; 
    102102        pkt->icmp_cksum = in_cksum((unsigned short *) pkt, sizeof(packet)); 
    103103 
    104         c = xsendto(pingsock, packet, DEFDATALEN + ICMP_MINLEN, 
     104        c = xsendto(pingsock, packet, datalen + ICMP_MINLEN, 
    105105                           (struct sockaddr *) &pingaddr, sizeof(pingaddr)); 
    106106 
    107107        /* listen for replies */ 
    static void ping6(len_and_sockaddr *lsa) 
    135135        struct icmp6_hdr *pkt; 
    136136        int pingsock, c; 
    137137        int sockopt; 
    138         char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN]; 
     138        char packet[datalen + ICMP_MINLEN + MAXIPLEN + MAXICMPLEN]; 
    139139 
    140140        pingsock = create_icmp6_socket(); 
    141141        pingaddr = lsa->u.sin6; 
    static void ping6(len_and_sockaddr *lsa) 
    147147        sockopt = offsetof(struct icmp6_hdr, icmp6_cksum); 
    148148        setsockopt(pingsock, SOL_RAW, IPV6_CHECKSUM, &sockopt, sizeof(sockopt)); 
    149149 
    150         c = xsendto(pingsock, packet, DEFDATALEN + sizeof (struct icmp6_hdr), 
     150        c = xsendto(pingsock, packet, datalen + sizeof (struct icmp6_hdr), 
    151151                           (struct sockaddr *) &pingaddr, sizeof(pingaddr)); 
    152152 
    153153        /* listen for replies */ 
Note: See TracBrowser for help on using the repository browser.