X-Git-Url: http://sjero.net/git/?p=strip6in4;a=blobdiff_plain;f=strip6in4.c;h=539d65f2899cfd06c203d871db89fd0df2dcb91b;hp=e15122036e76e368e59a6c6bb49d8a9e1e2b742b;hb=526da1d617724df4f3b363d102c6b32502275f44;hpb=16a8d4c4fa832ae6810f46e8863bb03a55f79333 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; }