On Thu, Dec 03, 2020 at 10:56:17PM +0300, Vitaliy Makkoveev wrote:
> > On 3 Dec 2020, at 13:20, Martin Vahlensieck <open...@academicsolutions.ch> 
> > wrote:
> > 
> > Hi
> 
> Hi.
> 
Hi

> > 
> > This is unused.  It has been in there since the import from NetBSD.
> > Their logs show that tcpgram.y and tcplex.l have been removed in 1995.
> > I am not sure what the policy is for the getopt(3) call: Should Y be
> > removed in the optstring as well (not done in this diff)?
> > 
> 
> There are two getopt(3) strings: one in privsep.c and one in tcpdump.c.
> “Y” should be removed from both. With this fix your diff is ok by me
> and I’ll commit it.

Done, updated diff below. Good catch with privsep.c.

Thanks.

Best,

Martin

Index: Makefile
===================================================================
RCS file: /cvs/src/usr.sbin/tcpdump/Makefile,v
retrieving revision 1.66
diff -u -p -r1.66 Makefile
--- Makefile    21 Jun 2020 05:00:17 -0000      1.66
+++ Makefile    4 Dec 2020 00:02:25 -0000
@@ -30,8 +30,8 @@ CFLAGS+=-I${.CURDIR}/../../lib/libpcap
 
 CFLAGS+=-DCSLIP -DPPP -DHAVE_FDDI -DETHER_SERVICE -DHAVE_ETHER_NTOHOST -DINET6
 
-LDADD+=        -lpcap -ll -lcrypto
-DPADD+=        ${LIBL} ${LIBPCAP} ${LIBCRYPTO}
+LDADD+=        -lpcap -lcrypto
+DPADD+=        ${LIBPCAP} ${LIBCRYPTO}
 
 SRCS=  tcpdump.c addrtoname.c privsep.c privsep_fdpass.c privsep_pcap.c \
        print-ether.c print-ip.c print-arp.c print-tcp.c print-udp.c \
Index: privsep.c
===================================================================
RCS file: /cvs/src/usr.sbin/tcpdump/privsep.c,v
retrieving revision 1.54
diff -u -p -r1.54 privsep.c
--- privsep.c   28 Jun 2019 13:32:51 -0000      1.54
+++ privsep.c   4 Dec 2020 00:02:25 -0000
@@ -224,7 +224,7 @@ priv_exec(int argc, char *argv[])
        /* parse the arguments for required options */
        opterr = 0;
        while ((i = getopt(argc, argv,
-           "aB:c:D:deE:fF:i:lLnNOopPqr:s:StT:vw:xXy:Y")) != -1) {
+           "aB:c:D:deE:fF:i:lLnNOopPqr:s:StT:vw:xXy:")) != -1) {
                switch (i) {
                case 'n':
                        nflag++;
Index: tcpdump.c
===================================================================
RCS file: /cvs/src/usr.sbin/tcpdump/tcpdump.c,v
retrieving revision 1.94
diff -u -p -r1.94 tcpdump.c
--- tcpdump.c   17 Aug 2020 06:29:29 -0000      1.94
+++ tcpdump.c   4 Dec 2020 00:02:26 -0000
@@ -232,7 +232,7 @@ main(int argc, char **argv)
 
        opterr = 0;
        while ((op = getopt(argc, argv,
-           "AaB:c:D:deE:fF:i:IlLnNOopqr:s:StT:vw:xXy:Y")) != -1)
+           "AaB:c:D:deE:fF:i:IlLnNOopqr:s:StT:vw:xXy:")) != -1)
                switch (op) {
 
                case 'A':
@@ -392,15 +392,7 @@ main(int argc, char **argv)
                case 'w':
                        WFileName = optarg;
                        break;
-#ifdef YYDEBUG
-               case 'Y':
-                       {
-                       /* Undocumented flag */
-                       extern int yydebug;
-                       yydebug = 1;
-                       }
-                       break;
-#endif
+
                case 'y':
                        i = pcap_datalink_name_to_val(optarg);
                        if (i < 0)
> 
> > Best,
> > 
> > Martin
> > 
> > Index: Makefile
> > ===================================================================
> > RCS file: /cvs/src/usr.sbin/tcpdump/Makefile,v
> > retrieving revision 1.66
> > diff -u -p -r1.66 Makefile
> > --- Makefile        21 Jun 2020 05:00:17 -0000      1.66
> > +++ Makefile        3 Dec 2020 10:15:35 -0000
> > @@ -30,8 +30,8 @@ CFLAGS+=-I${.CURDIR}/../../lib/libpcap
> > 
> > CFLAGS+=-DCSLIP -DPPP -DHAVE_FDDI -DETHER_SERVICE -DHAVE_ETHER_NTOHOST 
> > -DINET6
> > 
> > -LDADD+=    -lpcap -ll -lcrypto
> > -DPADD+=    ${LIBL} ${LIBPCAP} ${LIBCRYPTO}
> > +LDADD+=    -lpcap -lcrypto
> > +DPADD+=    ${LIBPCAP} ${LIBCRYPTO}
> > 
> > SRCS=       tcpdump.c addrtoname.c privsep.c privsep_fdpass.c 
> > privsep_pcap.c \
> >     print-ether.c print-ip.c print-arp.c print-tcp.c print-udp.c \
> > Index: tcpdump.c
> > ===================================================================
> > RCS file: /cvs/src/usr.sbin/tcpdump/tcpdump.c,v
> > retrieving revision 1.94
> > diff -u -p -r1.94 tcpdump.c
> > --- tcpdump.c       17 Aug 2020 06:29:29 -0000      1.94
> > +++ tcpdump.c       3 Dec 2020 10:15:35 -0000
> > @@ -392,15 +392,7 @@ main(int argc, char **argv)
> >             case 'w':
> >                     WFileName = optarg;
> >                     break;
> > -#ifdef YYDEBUG
> > -           case 'Y':
> > -                   {
> > -                   /* Undocumented flag */
> > -                   extern int yydebug;
> > -                   yydebug = 1;
> > -                   }
> > -                   break;
> > -#endif
> > +
> >             case 'y':
> >                     i = pcap_datalink_name_to_val(optarg);
> >                     if (i < 0)
> > 
> 

Reply via email to