diff --git a/CHANGES b/CHANGES index 715f6fa1e..953c5211d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,12 @@ +2.4.1 (2015-04-21): +* Merge between 2.4.0 and 2.3.1 + 2.4.0: (2015-03-24) * ARP improvements (#118) +2.3.1 (2015-03-31): +* Do not raise an assertion if an IP frame has extra trailing bytes (#221). + 2.3.0 (2015-03-09): * Fix `STACKV4` for the `DEVICE` signature which has `connect` removed (in Mirage types 2.3+). diff --git a/_oasis b/_oasis index 4831a171b..9e8973f0e 100644 --- a/_oasis +++ b/_oasis @@ -1,6 +1,6 @@ OASISFormat: 0.4 Name: tcpip -Version: 2.4.0 +Version: 2.4.1 Synopsis: Ethernet, TCP/IPv4 and DHCPv4 library Authors: Anil Madhavapeddy, Balraj Singh, Richard Mortier, Nicolas Ojeda Bar, Thomas Gazagnaire diff --git a/lib/META b/lib/META index 4fee9e720..4ed965663 100644 --- a/lib/META +++ b/lib/META @@ -1,6 +1,6 @@ # OASIS_START -# DO NOT EDIT (digest: 4cab3fdf69d9f517a1698b4c19c9e75a) -version = "2.4.0" +# DO NOT EDIT (digest: 2d1b9525b9bbdadb8aa16578f62a0f66) +version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "io-page mirage-types ipaddr cstruct mirage-profile bytes" archive(byte) = "tcpip.cma" @@ -10,7 +10,7 @@ archive(native, plugin) = "tcpip.cmxs" xen_linkopts = "-ltcpip_xen_stubs" exists_if = "tcpip.cma" package "xen" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" archive(byte) = "tcpip_xen.cma" archive(byte, plugin) = "tcpip_xen.cma" @@ -20,7 +20,7 @@ package "xen" ( ) package "udpv6-unix" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "tcpip.udp tcpip.ipv6-unix lwt lwt.unix ipaddr.unix cstruct.lwt io-page.unix" @@ -32,7 +32,7 @@ package "udpv6-unix" ( ) package "udpv6-socket" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "tcpip.udp lwt lwt.unix ipaddr.unix cstruct.lwt io-page.unix" archive(byte) = "udpv6-socket.cma" @@ -43,7 +43,7 @@ package "udpv6-socket" ( ) package "udpv4-unix" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "tcpip.udp tcpip.ipv4-unix lwt lwt.unix ipaddr.unix cstruct.lwt io-page.unix" @@ -55,7 +55,7 @@ package "udpv4-unix" ( ) package "udpv4-socket" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "tcpip.udp lwt lwt.unix ipaddr.unix cstruct.lwt io-page.unix" archive(byte) = "udpv4-socket.cma" @@ -66,7 +66,7 @@ package "udpv4-socket" ( ) package "udp" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "io-page mirage-types ipaddr cstruct lwt tcpip" archive(byte) = "udp.cma" @@ -77,7 +77,7 @@ package "udp" ( ) package "tcpv6-unix" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "tcpip.tcp tcpip.ipv6-unix tcpip.channel lwt lwt.unix mirage-unix mirage-clock-unix ipaddr.unix cstruct.lwt io-page.unix" @@ -89,7 +89,7 @@ package "tcpv6-unix" ( ) package "tcpv6-socket" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "lwt lwt.unix ipaddr.unix cstruct.lwt io-page.unix" archive(byte) = "tcpv6-socket.cma" @@ -100,7 +100,7 @@ package "tcpv6-socket" ( ) package "tcpv4-unix" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "tcpip.tcp tcpip.ipv4-unix tcpip.channel lwt lwt.unix mirage-unix mirage-clock-unix ipaddr.unix cstruct.lwt io-page.unix" @@ -112,7 +112,7 @@ package "tcpv4-unix" ( ) package "tcpv4-socket" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "lwt lwt.unix ipaddr.unix cstruct.lwt io-page.unix" archive(byte) = "tcpv4-socket.cma" @@ -123,7 +123,7 @@ package "tcpv4-socket" ( ) package "tcp" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "io-page mirage-types ipaddr cstruct lwt tcpip tcpip.ipv4 tcpip.ipv6" @@ -135,7 +135,7 @@ package "tcp" ( ) package "stack-unix" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "tcpip.udpv4-unix tcpip.tcpv4-unix tcpip.udpv6-unix tcpip.tcpv6-unix tcpip.stack-direct lwt lwt.unix ipaddr.unix mirage-unix mirage-clock-unix mirage-console.unix mirage-types.lwt io-page.unix" @@ -147,7 +147,7 @@ package "stack-unix" ( ) package "stack-socket" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "tcpip.udpv4-socket tcpip.udpv6-socket tcpip.tcpv4-socket tcpip.tcpv6-socket lwt lwt.unix ipaddr.unix io-page.unix" @@ -159,7 +159,7 @@ package "stack-socket" ( ) package "stack-direct" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "io-page mirage-types ipaddr cstruct lwt tcpip.ethif tcpip.udp tcpip.tcp tcpip.dhcpv4" @@ -171,7 +171,7 @@ package "stack-direct" ( ) package "ipv6-unix" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "tcpip.ethif-unix tcpip.ipv6 lwt lwt.unix" archive(byte) = "ipv6-unix.cma" @@ -182,7 +182,7 @@ package "ipv6-unix" ( ) package "ipv6" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "io-page mirage-types ipaddr cstruct lwt tcpip" archive(byte) = "ipv6.cma" @@ -193,7 +193,7 @@ package "ipv6" ( ) package "ipv4-unix" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "tcpip.ethif-unix tcpip.ipv4 lwt lwt.unix" archive(byte) = "ipv4-unix.cma" @@ -204,7 +204,7 @@ package "ipv4-unix" ( ) package "ipv4" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "io-page mirage-types ipaddr cstruct lwt tcpip" archive(byte) = "ipv4.cma" @@ -215,7 +215,7 @@ package "ipv4" ( ) package "ethif-unix" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "tcpip.ethif mirage-net-unix lwt lwt.unix" archive(byte) = "ethif-unix.cma" @@ -226,7 +226,7 @@ package "ethif-unix" ( ) package "ethif" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "tcpip io-page mirage-types ipaddr cstruct lwt" archive(byte) = "ethif.cma" @@ -237,7 +237,7 @@ package "ethif" ( ) package "dhcpv4" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "io-page bytes mirage-types ipaddr cstruct lwt tcpip.udp" archive(byte) = "dhcpv4.cma" @@ -248,7 +248,7 @@ package "dhcpv4" ( ) package "channel" ( - version = "2.4.0" + version = "2.4.1" description = "Ethernet, TCP/IPv4 and DHCPv4 library" requires = "io-page mirage-types ipaddr cstruct lwt" archive(byte) = "channel.cma" diff --git a/lib/ipv4.ml b/lib/ipv4.ml index bca9374f9..8e39652aa 100644 --- a/lib/ipv4.ml +++ b/lib/ipv4.ml @@ -185,15 +185,15 @@ module Make(Ethif : V1_LWT.ETHIF) (Clock : V1.CLOCK) (Time : V1_LWT.TIME) = stru let src = Ipaddr.V4.of_int32 (Wire_structs.Ipv4_wire.get_ipv4_src buf) in let dst = Ipaddr.V4.of_int32 (Wire_structs.Ipv4_wire.get_ipv4_dst buf) in let payload_len = Wire_structs.Ipv4_wire.get_ipv4_len buf - ihl in - (* XXX this will raise exception for 0-length payload *) let hdr, data = Cstruct.split buf ihl in - assert (Cstruct.len data = payload_len); - let proto = Wire_structs.Ipv4_wire.get_ipv4_proto buf in - match Wire_structs.Ipv4_wire.int_to_protocol proto with - | Some `ICMP -> icmp_input t src hdr data - | Some `TCP -> tcp ~src ~dst data - | Some `UDP -> udp ~src ~dst data - | None -> default ~proto ~src ~dst data + if Cstruct.len data >= payload_len then begin + let proto = Wire_structs.Ipv4_wire.get_ipv4_proto buf in + match Wire_structs.Ipv4_wire.int_to_protocol proto with + | Some `ICMP -> icmp_input t src hdr data + | Some `TCP -> tcp ~src ~dst data + | Some `UDP -> udp ~src ~dst data + | None -> default ~proto ~src ~dst data + end else return_unit let connect ethif = let ip = Ipaddr.V4.any in diff --git a/opam b/opam index 2b3f60e03..328f4031a 100644 --- a/opam +++ b/opam @@ -1,6 +1,4 @@ opam-version: "1.2" -name: "tcpip" -version: "2.2.3" maintainer: "anil@recoil.org" homepage: "https://github.com/mirage/mirage-tcpip" dev-repo: "https://github.com/mirage/mirage-tcpip.git" diff --git a/setup.ml b/setup.ml index ca2f093a2..48443f8c9 100644 --- a/setup.ml +++ b/setup.ml @@ -1,7 +1,7 @@ (* setup.ml generated for the first time by OASIS v0.4.5 *) (* OASIS_START *) -(* DO NOT EDIT (digest: 5ecc67f782f7fff3d18ec45c40e12b7f) *) +(* DO NOT EDIT (digest: c5d0426515a6e93fdacfc5d6dfba6a7f) *) (* Regenerated by OASIS v0.4.5 Visit http://oasis.forge.ocamlcore.org for more information and @@ -6673,7 +6673,7 @@ let setup_t = alpha_features = []; beta_features = []; name = "tcpip"; - version = "2.4.0"; + version = "2.4.1"; license = OASISLicense.DEP5License (OASISLicense.DEP5Unit @@ -7658,7 +7658,7 @@ let setup_t = }; oasis_fn = Some "_oasis"; oasis_version = "0.4.5"; - oasis_digest = Some "\150Ïÿ\n\015>tA\004«\007¯\152¾\012/"; + oasis_digest = Some "ü·Ý³óýª\n\0019%\159\012÷\150"; oasis_exec = None; oasis_setup_args = []; setup_update = false