Skip to content

Commit

Permalink
Merge pull request #231 from appneta/Release_4.1.1.beta3
Browse files Browse the repository at this point in the history
fix compiler warnings
  • Loading branch information
fklassen committed Dec 20, 2015
2 parents 86c628f + be2d509 commit 2c24cac
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/common/sendpacket.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ static int get_iface_index(int fd, const char *device, char *);

#ifdef HAVE_TUNTAP
#ifdef HAVE_LINUX
#include <net/if.h>
#include <linux/if_tun.h>
#elif defined(HAVE_FREEBSD)
#define TUNTAP_DEVICE_PREFIX "/dev/"
Expand Down Expand Up @@ -775,7 +776,7 @@ sendpacket_get_hwaddr_pcap(sendpacket_t *sp)
}
#endif /* HAVE_PCAP_INJECT || HAVE_PCAP_SENDPACKET */

#if defined HAVE_LIBDNET
#if defined HAVE_LIBDNET && !defined HAVE_PF_PACKET && !defined HAVE_BPF
/**
* Inner sendpacket_open() method for using libdnet
*/
Expand Down Expand Up @@ -806,7 +807,7 @@ sendpacket_open_libdnet(const char *device, char *errbuf)
static struct tcpr_ether_addr *
sendpacket_get_hwaddr_libdnet(sendpacket_t *sp)
{
struct tcpr_ether_addr *addr;
struct tcpr_ether_addr *addr = NULL;
int ret;
assert(sp);

Expand Down
3 changes: 0 additions & 3 deletions src/fragroute/mod_ip6_opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ int
ip6_opt_apply(void *d, struct pktq *pktq)
{
struct ip6_opt_data *opt = (struct ip6_opt_data *)d;
struct __ip6_ext_data_routing* route;
struct ip6_ext_hdr* ext;
int offset, len;
struct pkt *pkt;
Expand All @@ -134,8 +133,6 @@ ip6_opt_apply(void *d, struct pktq *pktq)

len = (IP6_ADDR_LEN / 8) * opt->u.route.segments;

route = (struct __ip6_ext_data_routing*)ext;

ext->ext_data.routing.type = 0;
ext->ext_data.routing.segleft = opt->u.route.segments;
((uint32_t*)ext)[1] = 0; /* reserved */
Expand Down
2 changes: 1 addition & 1 deletion src/fragroute/mod_print.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ _print_ip6(u_char *p, int length)
default:
printf("%s > %s:", ip6_ntoa(&ip6->ip6_src),
ip6_ntoa(&ip6->ip6_dst));
printf(" ip-proto-%hhu ttl %hhu payload len %hu", ip6->ip6_nxt,
printf(" ip-proto-%hhu ttl %hhu payload len %d", ip6->ip6_nxt,
ip6->ip6_hlim, plen);
break;
}
Expand Down
9 changes: 7 additions & 2 deletions src/tcpreplay_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,14 @@ tcpreplay_post_args(tcpreplay_t *ctx, int argc)
options->speed.mode = speed_oneatatime;
options->speed.speed = 0;
} else if (HAVE_OPT(MBPS)) {
options->speed.mode = speed_mbpsrate;
n = atof(OPT_ARG(MBPS));
options->speed.speed = (COUNTER)(n * 1000000.0); /* convert to bps */
if (n) {
options->speed.mode = speed_mbpsrate;
options->speed.speed = (COUNTER)(n * 1000000.0); /* convert to bps */
} else {
options->speed.mode = speed_topspeed;
options->speed.speed = 0;
}
} else if (HAVE_OPT(MULTIPLIER)) {
options->speed.mode = speed_multiplier;
options->speed.multiplier = atof(OPT_ARG(MULTIPLIER));
Expand Down
3 changes: 1 addition & 2 deletions src/tcprewrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ rewrite_packets(tcpedit_t *tcpedit, pcap_t *pin, pcap_dumper_t *pout)
COUNTER packetnum = 0;
int rcode;
#ifdef ENABLE_FRAGROUTE
int frag_len, i, proto;
int frag_len, proto;
#endif

pkthdr_ptr = &pkthdr;
Expand Down Expand Up @@ -302,7 +302,6 @@ rewrite_packets(tcpedit_t *tcpedit, pcap_t *pin, pcap_dumper_t *pout)
if (fragroute_process(options.frag_ctx, *pktdata, pkthdr_ptr->caplen) < 0)
errx(-1, "Error processing packet via fragroute: %s", options.frag_ctx->errbuf);

i = 0;
while ((frag_len = fragroute_getfragment(options.frag_ctx, &frag)) > 0) {
/* frags get the same timestamp as the original packet */
dbgx(1, "processing packet " COUNTER_SPEC " frag: %u (%d)", packetnum, i++, frag_len);
Expand Down

0 comments on commit 2c24cac

Please sign in to comment.