]> The Tcpdump Group git mirrors - libpcap/commitdiff
Check whether the compiler on Travis allows mixed declarations and code.
authorGuy Harris <[email protected]>
Thu, 24 May 2018 22:56:00 +0000 (15:56 -0700)
committerGuy Harris <[email protected]>
Thu, 24 May 2018 22:56:00 +0000 (15:56 -0700)
It *should*, as we should be asking for at least C99, if not "gnu99".

pcap-rpcap.c

index 42f381c8627378544d03c849ebe31f9dab190194..d85b0d3dd20acdc84691efb90e3f086bfbf4217f 100644 (file)
@@ -372,7 +372,6 @@ rpcap_deseraddr(struct rpcap_sockaddr *sockaddrin, struct sockaddr_storage **soc
 static int pcap_read_nocb_remote(pcap_t *p, struct pcap_pkthdr *pkt_header, u_char **pkt_data)
 {
        struct pcap_rpcap *pr = p->priv;        /* structure used when doing a remote live capture */
 static int pcap_read_nocb_remote(pcap_t *p, struct pcap_pkthdr *pkt_header, u_char **pkt_data)
 {
        struct pcap_rpcap *pr = p->priv;        /* structure used when doing a remote live capture */
-       struct rpcap_header *header;            /* general header according to the RPCAP format */
        struct rpcap_pkthdr *net_pkt_header;    /* header of the packet, from the message */
        u_char *net_pkt_data;                   /* packet data from the message */
        uint32 plen;
        struct rpcap_pkthdr *net_pkt_header;    /* header of the packet, from the message */
        u_char *net_pkt_data;                   /* packet data from the message */
        uint32 plen;
@@ -421,7 +420,7 @@ static int pcap_read_nocb_remote(pcap_t *p, struct pcap_pkthdr *pkt_header, u_ch
         * We have to define 'header' as a pointer to a larger buffer,
         * because in case of UDP we have to read all the message within a single call
         */
         * We have to define 'header' as a pointer to a larger buffer,
         * because in case of UDP we have to read all the message within a single call
         */
-       header = (struct rpcap_header *) p->buffer;
+       struct rpcap_header *header = (struct rpcap_header *) p->buffer;
        net_pkt_header = (struct rpcap_pkthdr *) ((char *)p->buffer + sizeof(struct rpcap_header));
        net_pkt_data = (u_char *)p->buffer + sizeof(struct rpcap_header) + sizeof(struct rpcap_pkthdr);
 
        net_pkt_header = (struct rpcap_pkthdr *) ((char *)p->buffer + sizeof(struct rpcap_header));
        net_pkt_data = (u_char *)p->buffer + sizeof(struct rpcap_header) + sizeof(struct rpcap_pkthdr);