X-Git-Url: https://www.hackdaworld.org/gitweb/?a=blobdiff_plain;f=hdw-sniff.c;h=bd0b8edabee6a367ff58a8951fbd60ab5ab6d104;hb=f495a11c9e880f1f55aa8e6c44c065228e55e5c5;hp=d2e70776557d7ecd3b45cf68f2fcbcbb5eb68284;hpb=91a86e79de34bb35c6abd72f6f71990de904915c;p=my-code%2Fhdw-sniff.git diff --git a/hdw-sniff.c b/hdw-sniff.c index d2e7077..bd0b8ed 100644 --- a/hdw-sniff.c +++ b/hdw-sniff.c @@ -172,7 +172,7 @@ void pcap_process(u_char *info,const struct pcap_pkthdr *pcap_header, /* ieee802.11 header */ /* we need smaller w_hdr for non distributed frames */ - if((w_hdr->frame_ctl & (1<<8)) & (w_hdr->frame_ctl & (1<<9))) { + if((w_hdr->frame_ctl & (1<<8)) && (w_hdr->frame_ctl & (1<<9))) { printf("=> distributed packet !!!!11\n"); } else w_o-=(sizeof(struct snaphdr)-sizeof(unsigned short)); @@ -207,9 +207,11 @@ void pcap_process(u_char *info,const struct pcap_pkthdr *pcap_header, :strcpy(tmp_buf1,"ibssid = "); strncpy(tmp_buf2,beacon_hdr->ssid_s.ssid, beacon_hdr->ssid_s.length); + tmp_buf2[beacon_hdr->ssid_s.length]='\0'; strcpy(tmp_buf,"beacon"); - add_ssid_2_list(tmp_buf2,my_info_struct->ssid_list); + add_ssid_2_list(tmp_buf2,beacon_hdr->capability, + my_info_struct->ssid_list); } else if((w_hdr->frame_ctl & IEEE802_11_STYPE_ATIM)>0) strcpy(tmp_buf,"announcement traffic indication message"); @@ -224,7 +226,7 @@ void pcap_process(u_char *info,const struct pcap_pkthdr *pcap_header, else strcpy(tmp_buf,"control or data frame type"); printf("=> %s\n",tmp_buf); - if(strlen(tmp_buf1)>0 & strlen(tmp_buf2)>0) printf(" %s%s\n", + if((strlen(tmp_buf1)>0) && (strlen(tmp_buf2)>0)) printf(" %s%s\n", tmp_buf1, tmp_buf2); printf("duration/id: 0x%x\n",w_hdr->duration_id); @@ -264,7 +266,7 @@ void pcap_process(u_char *info,const struct pcap_pkthdr *pcap_header, printf("- no encryption!\n"); if(snap_hdr->proto==ntohs(ETH_P_IP)) { e_o=sizeof(struct snaphdr); - parse_ip(snap_hdr+e_o); + parse_ip((char *)(snap_hdr+e_o)); } }