VirtualBox

Changeset 50189 in vbox


Ignore:
Timestamp:
Jan 23, 2014 4:55:24 PM (11 years ago)
Author:
vboxsync
Message:

lwip: Sync with git master up to
commit 018719d9d3229bcc7e05995be2221dd13eb724ee
Date: Fri Jan 17 22:32:36 2014 +0100

Provide missing options to disable checksum generation and
verification.

Since the options are on by default, the same object code is
generated.

Location:
trunk/src/VBox/Devices/Network/lwip-new
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/lwip-new/CHANGELOG

    r50185 r50189  
    66
    77 ++ New features:
     8
     9  2014-01-17: Jiri Engelthaler
     10  * icmp, icmp6, opt.h: patch #8027: Completed HW checksuming for IPv4 and
     11    IPv6 ICMP's
    812
    913  2012-03-25: Simon Goldschmidt (idea by Mason)
  • trunk/src/VBox/Devices/Network/lwip-new/src/core/ipv4/icmp.c

    r49854 r50189  
    146146      goto lenerr;
    147147    }
     148#if CHECKSUM_CHECK_ICMP
    148149    if (inet_chksum_pbuf(p) != 0) {
    149150      LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: checksum failed for received ICMP echo\n"));
     
    153154      return;
    154155    }
     156#endif
    155157#if LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN
    156158    if (pbuf_header(p, (PBUF_IP_HLEN + PBUF_LINK_HLEN))) {
     
    428430  /* calculate checksum */
    429431  icmphdr->chksum = 0;
     432#if CHECKSUM_GEN_ICMP
    430433  icmphdr->chksum = inet_chksum(icmphdr, q->len);
     434#endif
    431435  ICMP_STATS_INC(icmp.xmit);
    432436  /* increase number of messages attempted to send */
  • trunk/src/VBox/Devices/Network/lwip-new/src/core/ipv4/ip_frag.c

    r47886 r50189  
    580580    IPH_CHKSUM_SET(fraghdr, 0);
    581581    /* @todo: do we need to set calculate the correct checksum? */
     582#if CHECKSUM_GEN_IP
    582583    IPH_CHKSUM_SET(fraghdr, inet_chksum(fraghdr, IP_HLEN));
     584#endif /* CHECKSUM_GEN_IP */
    583585
    584586    p = ipr->p;
     
    812814    IPH_LEN_SET(iphdr, htons(cop + IP_HLEN));
    813815    IPH_CHKSUM_SET(iphdr, 0);
     816#if CHECKSUM_GEN_IP
    814817    IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN));
     818#endif /* CHECKSUM_GEN_IP */
    815819
    816820#if IP_FRAG_USES_STATIC_BUF
  • trunk/src/VBox/Devices/Network/lwip-new/src/core/ipv6/icmp6.c

    r49592 r50189  
    102102  icmp6hdr = (struct icmp6_hdr *)p->payload;
    103103
    104 #if LWIP_ICMP6_CHECKSUM_CHECK
     104#if CHECKSUM_CHECK_ICMP6
    105105  if (ip6_chksum_pseudo(p, IP6_NEXTH_ICMP6, p->tot_len, ip6_current_src_addr(),
    106106                        ip6_current_dest_addr()) != 0) {
     
    111111    return;
    112112  }
    113 #endif /* LWIP_ICMP6_CHECKSUM_CHECK */
     113#endif /* CHECKSUM_CHECK_ICMP6 */
    114114
    115115  switch (icmp6hdr->type) {
     
    185185    ((struct icmp6_echo_hdr *)(r->payload))->type = ICMP6_TYPE_EREP;
    186186    ((struct icmp6_echo_hdr *)(r->payload))->chksum = 0;
     187#if CHECKSUM_GEN_ICMP6
    187188    ((struct icmp6_echo_hdr *)(r->payload))->chksum = ip6_chksum_pseudo(r,
    188189        IP6_NEXTH_ICMP6, r->tot_len, reply_src, ip6_current_src_addr());
     190#endif /* CHECKSUM_GEN_ICMP6 */
    189191
    190192    /* Send reply. */
     
    395397  /* calculate checksum */
    396398  icmp6hdr->chksum = 0;
     399#if CHECKSUM_GEN_ICMP6
    397400  icmp6hdr->chksum = ip6_chksum_pseudo(q, IP6_NEXTH_ICMP6, q->tot_len,
    398401    reply_src, reply_dest);
     402#endif /* CHECKSUM_GEN_ICMP6 */
    399403
    400404  ICMP6_STATS_INC(icmp6.xmit);
  • trunk/src/VBox/Devices/Network/lwip-new/src/core/ipv6/mld6.c

    r47886 r50189  
    567567  ip6_addr_set(&(mld_hdr->multicast_address), &(group->group_address));
    568568
     569#if CHECKSUM_GEN_ICMP6
    569570  mld_hdr->chksum = ip6_chksum_pseudo(p, IP6_NEXTH_ICMP6, p->len,
    570571    src_addr, &(group->group_address));
     572#endif /* CHECKSUM_GEN_ICMP6 */
    571573
    572574  /* Add hop-by-hop headers options: router alert with MLD value. */
  • trunk/src/VBox/Devices/Network/lwip-new/src/core/ipv6/nd6.c

    r47886 r50189  
    889889  }
    890890
     891#if CHECKSUM_GEN_ICMP6
    891892  ns_hdr->chksum = ip6_chksum_pseudo(p, IP6_NEXTH_ICMP6, p->len, src_addr,
    892893    target_addr);
     894#endif /* CHECKSUM_GEN_ICMP6 */
    893895
    894896  /* Send the packet out. */
     
    961963  }
    962964
     965#if CHECKSUM_GEN_ICMP6
    963966  na_hdr->chksum = ip6_chksum_pseudo(p, IP6_NEXTH_ICMP6, p->len, src_addr,
    964967    dest_addr);
     968#endif /* CHECKSUM_GEN_ICMP6 */
    965969
    966970  /* Send the packet out. */
     
    10281032  }
    10291033
     1034#if CHECKSUM_GEN_ICMP6
    10301035  rs_hdr->chksum = ip6_chksum_pseudo(p, IP6_NEXTH_ICMP6, p->len, src_addr,
    10311036    &multicast_address);
     1037#endif /* CHECKSUM_GEN_ICMP6 */
    10321038
    10331039  /* Send the packet out. */
  • trunk/src/VBox/Devices/Network/lwip-new/src/include/lwip/opt.h

    r47886 r50189  
    18821882 
    18831883/**
     1884 * CHECKSUM_GEN_ICMP6==1: Generate checksums in software for outgoing ICMP6 packets.
     1885 */
     1886#ifndef CHECKSUM_GEN_ICMP6
     1887#define CHECKSUM_GEN_ICMP6              1
     1888#endif
     1889 
     1890/**
    18841891 * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.
    18851892 */
     
    19001907#ifndef CHECKSUM_CHECK_TCP
    19011908#define CHECKSUM_CHECK_TCP              1
     1909#endif
     1910
     1911/**
     1912 * CHECKSUM_CHECK_ICMP==1: Check checksums in software for incoming ICMP packets.
     1913 */
     1914#ifndef CHECKSUM_CHECK_ICMP
     1915#define CHECKSUM_CHECK_ICMP             1
     1916#endif
     1917
     1918/**
     1919 * CHECKSUM_CHECK_ICMP6==1: Check checksums in software for incoming ICMPv6 packets
     1920 */
     1921#ifndef CHECKSUM_CHECK_ICMP6
     1922#define CHECKSUM_CHECK_ICMP6            1
    19021923#endif
    19031924
     
    19561977#ifndef LWIP_ICMP6_HL
    19571978#define LWIP_ICMP6_HL                   255
    1958 #endif
    1959 
    1960 /**
    1961  * LWIP_ICMP6_CHECKSUM_CHECK==1: verify checksum on ICMPv6 packets
    1962  */
    1963 #ifndef LWIP_ICMP6_CHECKSUM_CHECK
    1964 #define LWIP_ICMP6_CHECKSUM_CHECK       1
    19651979#endif
    19661980
Note: See TracChangeset for help on using the changeset viewer.

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