source: patches/iputils-s20071127-fixes-1.patch @ 7d38869

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since 7d38869 was 7d38869, checked in by Jim Gifford <clfs@…>, 15 years ago

Replaced Inetutils with IPutils

  • Property mode set to 100644
File size: 6.3 KB
  • iputils-s20071127

    Submitted By: Jim Gifford (jim at cross-lfs dot org)
    Date: 01-15-2009
    Initial Package Version: s20071127
    Origin: Debian
    Upstream Status: Unknown
    Description: Fixes Various Issues
    
    diff -Naur iputils-s20071127.orig/Makefile iputils-s20071127/Makefile
    old new  
    1616CCOPT=-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g
    1717CFLAGS=$(CCOPT) $(GLIBCFIX) $(DEFINES)
    1818
    19 IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd
     19IPV4_TARGETS=tracepath ping arping
    2020IPV6_TARGETS=tracepath6 traceroute6 ping6
    2121TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS)
    2222
     
    2525
    2626all: $(TARGETS)
    2727
    28 
    2928tftpd: tftpd.o tftpsubs.o
    3029ping: ping.o ping_common.o
    3130ping6: ping6.o ping_common.o
     
    3736rdisc_srv.o: rdisc.c
    3837        $(CC) $(CFLAGS) -DRDISC_SERVER -o rdisc_srv.o rdisc.c
    3938
    40 
    4139check-kernel:
    4240ifeq ($(KERNEL_INCLUDE),)
    4341        @echo "Please, set correct KERNEL_INCLUDE"; false
  • iputils-s20071127

    diff -Naur iputils-s20071127.orig/arping.c iputils-s20071127/arping.c
    old new  
    168168        if (start.tv_sec==0)
    169169                start = tv;
    170170
    171         if (count-- == 0 || (timeout && MS_TDIFF(tv,start) > timeout*1000 + 500))
    172                 finish();
     171        if (timeout && MS_TDIFF(tv,start) > timeout*1000 + 500)
     172                finish();
    173173
    174         if (last.tv_sec==0 || MS_TDIFF(tv,last) > 500) {
     174        if ((!timeout) && (count == 0))
     175                finish();
     176 
     177        if ( count!=0  && (last.tv_sec==0 || MS_TDIFF(tv,last) > 500 ) ) {
    175178                send_pack(s, src, dst, &me, &he);
    176                 if (count == 0 && unsolicited)
     179                if (count >= 0)
     180                        count--;
     181                if (count==0 && unsolicited)
    177182                        finish();
    178183        }
    179184        alarm(1);
  • iputils-s20071127

    diff -Naur iputils-s20071127.orig/doc/Makefile iputils-s20071127/doc/Makefile
    old new  
    66
    77html: $(HTMLFILES) iputils.html
    88
    9 man: $(MANFILES)
     9man: $(MANFILES) fix_sgml2man
    1010
    1111# docbook scripts are incredibly dirty in the sense that they leak
    1212# lots of some strange temporary junk directories and files.
     
    3333        @set -e; cd tmp.db2man; nsgmls ../$< | sgmlspl ../docbook2man-spec.pl ; mv $@ ..
    3434        @-rm -rf tmp.db2man
    3535
     36fix_sgml2man:
     37        @sed -i -e 's!\\fB\\fIdestination\\fB\\fR \[\\fB/\\fIport\\fB\\fR\]!\\fB\\fIdestination\\fB\\fR[\\fB/\\fIport\\fB\\fR]!g' tracepath.8
     38
    3639clean:
    3740        @rm -rf $(MANFILES) $(HTMLFILES) iputils.html tmp.db2html tmp.db2man
    3841
  • doc/docbook2man-spec.pl

    diff -Naur iputils-s20071127.orig/doc/docbook2man-spec.pl iputils-s20071127/doc/docbook2man-spec.pl
    old new  
    428428        output ' ';
    429429
    430430        if($_[0]->attribute('CHOICE')->value =~ /opt/i) {
    431                 output '[ ';
     431                output '[';
    432432        }
    433433        bold_on();
    434434}
     
    441441                font_off();
    442442        }
    443443        if($_[0]->attribute('CHOICE')->value =~ /opt/i) {
    444                 output '] ';
     444                output ']';
    445445        }
    446446}
    447447
  • iputils-s20071127

    diff -Naur iputils-s20071127.orig/ping.c iputils-s20071127/ping.c
    old new  
    249249                        if (argc == 1)
    250250                                options |= F_NUMERIC;
    251251                } else {
    252                         hp = gethostbyname(target);
     252                        hp = gethostbyname2(target, AF_INET);
    253253                        if (!hp) {
    254254                                fprintf(stderr, "ping: unknown host %s\n", target);
    255255                                exit(2);
     
    865865                case ICMP_SR_FAILED:
    866866                        printf("Source Route Failed\n");
    867867                        break;
     868                case ICMP_NET_UNKNOWN:
     869                        printf("Destination Net Unknown\n");
     870                        break;
     871                case ICMP_HOST_UNKNOWN:
     872                        printf("Destination Host Unknown\n");
     873                        break;
     874                case ICMP_HOST_ISOLATED:
     875                        printf("Source Host Isolated\n");
     876                        break;
     877                case ICMP_NET_ANO:
     878                        printf("Destination Net Prohibited\n");
     879                        break;
     880                case ICMP_HOST_ANO:
     881                        printf("Destination Host Prohibited\n");
     882                        break;
     883                case ICMP_NET_UNR_TOS:
     884                        printf("Destination Net Unreachable for Type of Service\n");
     885                        break;
     886                case ICMP_HOST_UNR_TOS:
     887                        printf("Destination Host Unreachable for Type of Service\n");
     888                        break;
    868889                case ICMP_PKT_FILTERED:
    869890                        printf("Packet filtered\n");
    870891                        break;
     892                case ICMP_PREC_VIOLATION:
     893                        printf("Precedence Violation\n");
     894                        break;
     895                case ICMP_PREC_CUTOFF:
     896                        printf("Precedence Cutoff\n");
     897                        break;
    871898                default:
    872899                        printf("Dest Unreachable, Bad Code: %d\n", code);
    873900                        break;
  • iputils-s20071127

    diff -Naur iputils-s20071127.orig/ping6.c iputils-s20071127/ping6.c
    old new  
    414414                        fprintf(stderr, "ping: unknown iface %s\n", device);
    415415                        exit(2);
    416416                }
    417                 cmsg = (struct cmsghdr*)cmsgbuf;
     417                cmsg = (struct cmsghdr*)(cmsgbuf+cmsglen);
    418418                cmsglen += CMSG_SPACE(sizeof(*ipi));
    419419                cmsg->cmsg_len = CMSG_LEN(sizeof(*ipi));
    420420                cmsg->cmsg_level = SOL_IPV6;
     
    486486        /*
    487487         *      select icmp echo reply as icmp type to receive
    488488         */
    489 
    490489        ICMP6_FILTER_SETBLOCKALL(&filter);
    491490
    492491        if (!working_recverr) {
  • iputils-s20071127

    diff -Naur iputils-s20071127.orig/ping_common.c iputils-s20071127/ping_common.c
    old new  
    818818        }
    819819        if (pipesize > 1)
    820820                printf(", pipe %d", pipesize);
    821         if (ntransmitted > 1 && (!interval || (options&(F_FLOOD|F_ADAPTIVE)))) {
     821        if (ntransmitted > 1 && nreceived &&
     822                        (!interval || (options&(F_FLOOD|F_ADAPTIVE)))) {
    822823                int ipg = (1000000*(long long)tv.tv_sec+tv.tv_usec)/(ntransmitted-1);
    823824                printf(", ipg/ewma %d.%03d/%d.%03d ms",
    824825                       ipg/1000, ipg%1000, rtt/8000, (rtt/8)%1000);
     
    852853        }
    853854        fprintf(stderr, "\n");
    854855}
    855 
  • iputils-s20071127

    diff -Naur iputils-s20071127.orig/tracepath.c iputils-s20071127/tracepath.c
    old new  
    318318                base_port = atoi(p+1);
    319319        } else
    320320                base_port = 44444;
    321         he = gethostbyname(argv[0]);
     321        he = gethostbyname2(argv[0], AF_INET);
    322322        if (he == NULL) {
    323                 herror("gethostbyname");
     323                herror("gethostbyname2");
    324324                exit(1);
    325325        }
    326326        memcpy(&target.sin_addr, he->h_addr, 4);
Note: See TracBrowser for help on using the repository browser.