Windows 7 rejecting UDP packets -


i'm writing program should simultaneously send , receive special raw udp packets. fields (except mac-addresses) filled myself. , besides i'm using fake ip options like: fe 04 01 00 (i've tried different), whole ip header right. here example packet

  • macs: 30 85 a9 1f b8 d6 00 25 22 62 22 07 08 00
  • ip header: 48 00 00 3e 03 d0 00 00 40 11 bb b7 c0 a8 89 a1 c0 a8 89 01
    • ip options:
      • fd 04 01 00
      • fe 08 01 11 1d 15 0a 00
  • udp header, payload: c3 50 c3 55 00 1e d7 ce 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 11 22 33 44 55 66 77

issue

precondition: windows firewall disabled , no other firewall running. on windows 7 host program launched "run administrator". on windows xp user administrator.

when packet sent remote host windows xp (lan), or localhost on windows 7 or windows xp it's received(on remote host or localhost). if packet sent remote host windows 7 (lan) it's rejected remote host icmp message "parameter problem". can seen using (for example) wireshark: sample wireshark capture file

here's source code on sending

ressrc = resolveaddress(srcaddrstr, srcport, addressfamily, sockettype, protocol); if (ressrc == null) {   // handling }  resdest = resolveaddress(dstaddrstr, dstport, ressrc->ai_family, ressrc->ai_socktype, ressrc->ai_protocol); if (resdest == null)  {   // handling }  sendsock = socket(ressrc->ai_family, sockettype, ressrc->ai_protocol); if (sendsock == invalid_socket) {   // handling }  int optval = 1; rc = setsockopt(sendsock, ipproto_ip, ip_hdrincl, (char *)&optval, sizeof(optval)); if (rc == socket_error) {   // handling }  // packetizing wsabuf *wbuf = ...  rc = sendto(sendsock, wbuf[0].buf, wbuf[0].len, 0, resdest->ai_addr, resdest->ai_addrlen); 

and receiving

ressrc = resolveaddress(srcaddrstr, null, addressfamily, sockettype, protocol); if (ressrc == null) {     //handling }  recvsock = socket(ressrc->ai_family, sockettype, ressrc->ai_protocol); if (recvsock == invalid_socket) {     //handling }  rc = bind(recvsock, ressrc->ai_addr, ressrc->ai_addrlen); if (rc == socket_error) {     //handling }  while (1) {     fromlen = sizeof(safrom);     rc = recvfrom(recvsock, buf, max_packet, 0, (sockaddr *)&safrom, &fromlen);     if (rc == socket_error) {         //handling     }      /*      * handling received packet      */ } 

i've tried:

  • comparing packets received on different hosts (no differences)
  • putting receiving socket in promiscuous mode using wsaioctl , ioctlsocket functions
  • googling, thing i've found issue topic

what can cause problem? should turn on/off? or doing wrong else?


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -