19c3 updates
[my-code/hdw-sniff.git] / hdw-sniff.c
index d2e7077..bd0b8ed 100644 (file)
@@ -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));
                        }
 
                }