From: Samuel Jero Date: Thu, 21 Mar 2013 03:40:39 +0000 (-0400) Subject: Modify to output RAW packet capture correctly X-Git-Url: http://sjero.net/git/?p=strip6in4;a=commitdiff_plain;h=526da1d617724df4f3b363d102c6b32502275f44 Modify to output RAW packet capture correctly --- diff --git a/strip6in4.c b/strip6in4.c index e151220..539d65f 100644 --- a/strip6in4.c +++ b/strip6in4.c @@ -44,6 +44,7 @@ int main(int argc, char *argv[]) char *erbuffer=ebuf; char *sfile=NULL; char *dfile=NULL; + pcap_t* tmp; /*parse commandline options*/ if(argc > 9){ @@ -88,14 +89,15 @@ int main(int argc, char *argv[]) } /*attempt to open input file*/ - in=pcap_open_offline(dfile, erbuffer); + in=pcap_open_offline(sfile, erbuffer); if(in==NULL){ dbgprintf(0,"Error opening input file\n"); exit(1); } /*attempt to open output file*/ - out=pcap_dump_open(in,dfile); + tmp=pcap_open_dead(DLT_RAW,65535); + out=pcap_dump_open(tmp,dfile); if(out==NULL){ dbgprintf(0,"Error opening output file\n"); exit(1); @@ -107,6 +109,7 @@ int main(int argc, char *argv[]) /*close files*/ pcap_close(in); + pcap_close(tmp); pcap_dump_close(out); return 0; }