From 526da1d617724df4f3b363d102c6b32502275f44 Mon Sep 17 00:00:00 2001 From: Samuel Jero Date: Wed, 20 Mar 2013 23:40:39 -0400 Subject: [PATCH] Modify to output RAW packet capture correctly --- strip6in4.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; } -- 2.39.2