VirtualBox

Changeset 50007 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Dec 27, 2013 1:12:35 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
91453
Message:

udp_proxy_input: verify udp checksum.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/lwip-new/src/core/udp.c

    r47886 r50007  
    533533  }
    534534
     535  LWIP_DEBUGF(UDP_DEBUG, ("udp_proxy_input: received datagram of length %"U16_F"\n", p->tot_len));
     536
    535537  udphdr = (struct udp_hdr *)p->payload;
    536 
    537   LWIP_DEBUGF(UDP_DEBUG, ("udp_proxy_input: received datagram of length %"U16_F"\n", p->tot_len));
     538  if (udphdr->chksum != 0) {
     539    LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE,
     540                ("udp_proxy_input: calculating checksum\n"));
     541    if (ipX_chksum_pseudo(ip_current_is_v6(), p, IP_PROTO_UDP, p->tot_len,
     542                          ipX_current_src_addr(),
     543                          ipX_current_dest_addr()) != 0)
     544    {
     545      LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_LEVEL_WARNING,
     546                  ("udp_proxy_input: UDP datagram discarded due to failing checksum\n"));
     547      UDP_STATS_INC(udp.chkerr);
     548      UDP_STATS_INC(udp.drop);
     549      snmp_inc_udpinerrors();
     550      pbuf_free(p);
     551      goto end;
     552    }
     553  }
    538554
    539555  /* convert src and dest ports to host byte order */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette