Skip to content

Commit c9726dc

Browse files
authored
Merge pull request #460 from djs55/prepare.0.3.0
Update CHANGES.md for v0.3.0
2 parents 218f014 + ba63af5 commit c9726dc

File tree

3 files changed

+46
-17
lines changed

3 files changed

+46
-17
lines changed

CHANGES.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
### v0.3.0 (2019-02-06)
2+
3+
* support multiplexing forwarded connections along one Hyper-V socket connection
4+
* add Kubernetes controller for exposing ports
5+
* go: move to go dep
6+
* support building Linux static binaries (with musl)
7+
* add a --gateway-forwards file for redirecting traffic to external services
8+
* udp: prevent too many flows exhausting all fds on the system
9+
* support forwarding to Unix domain sockets as well as TCP and UDP
10+
* go: move vmnet to its own package
11+
* test: add an nmap simulation test
12+
* vpnkit-{9pmount,tap}-vsock: fix operation on newer kernels with AF\_VSOCK
13+
* rename environment varible from DEBUG to VPNKIT\_DEBUG to avoid clashing with
14+
other software
15+
* tcp: disable keep-alives: they were causing a space leak
16+
* http: HTTP/1.0 should default to Connection:close
17+
* icmp: don't log parse failures
18+
* ntp: remove the automatic NTP forward to localhost: use the --gateway-forwards
19+
feature instead
20+
* http: handle Connection:close
21+
* http: consult the "localhost" names in the transparent proxy
22+
* http: support both hostnames and IPs in excludes
23+
* http: fix HTTP CONNECT
24+
* http: respect authorization headers
25+
* http: HEAD responses must not have bodies
26+
127
### v0.2.0 (2018-01-03)
228

329
* add 9pmount-vsock and tap-vsock helper programs

src/bin/main.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ let gateway_ip =
796796
let host_ip =
797797
let doc =
798798
Arg.info ~doc:
799-
"IP address which represents the host. Connections to this IP will be forwarded to localhost on the host."
799+
"IP address which represents the host. Connections to this IP will be forwarded to localhost on the host. Use the value 0.0.0.0 to disable this feature."
800800
[ "host-ip" ]
801801
in
802802
Arg.(value & opt string (Ipaddr.V4.to_string Configuration.default_host_ip) doc)

src/hostnet/slirp.ml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ struct
474474
clock: Clock.t;
475475
endpoint: Endpoint.t;
476476
udp_nat: Udp_nat.t;
477-
dns_ips: Ipaddr.V4.t list;
477+
dns_ips: Ipaddr.t list;
478478
}
479479
(** Proxies connections to services on localhost on the host *)
480480

@@ -989,11 +989,11 @@ struct
989989
>>= fun switch ->
990990

991991
(* Serve a static ARP table *)
992-
let local_arp_table = [
993-
c.Configuration.lowest_ip, client_macaddr;
994-
c.Configuration.gateway_ip, c.Configuration.server_macaddr;
995-
c.Configuration.host_ip, c.Configuration.server_macaddr;
996-
] in
992+
let local_arp_table =
993+
(c.Configuration.lowest_ip, client_macaddr)
994+
:: (c.Configuration.gateway_ip, c.Configuration.server_macaddr)
995+
:: (if Ipaddr.V4.(compare unspecified c.Configuration.host_ip = 0) then [] else [ c.Configuration.host_ip, c.Configuration.server_macaddr])
996+
in
997997
Global_arp_ethif.connect switch
998998
>>= fun global_arp_ethif ->
999999

@@ -1155,7 +1155,11 @@ struct
11551155
Global_arp.input arp (Cstruct.shift buf Ethif_wire.sizeof_ethernet)
11561156
| Ok (Ethernet { payload = Ipv4 ({ dst; _ } as ipv4 ); _ }) ->
11571157
(* For any new IP destination, create a stack to proxy for
1158-
the remote system *)
1158+
the remote system *)
1159+
let localhost_ips =
1160+
if Ipaddr.V4.(compare unspecified c.Configuration.host_ip) = 0
1161+
then []
1162+
else [ Ipaddr.V4 c.Configuration.host_ip ] in
11591163
if dst = c.Configuration.gateway_ip then begin
11601164
begin
11611165
let open Lwt_result.Infix in
@@ -1188,7 +1192,7 @@ struct
11881192
end in
11891193
Udp_nat.set_send_reply ~t:udp_nat ~send_reply;
11901194
Gateway.create clock endpoint udp_nat [ c.Configuration.gateway_ip ]
1191-
c.Configuration.host_names [ Ipaddr.V4 c.Configuration.host_ip ]
1195+
c.Configuration.host_names localhost_ips
11921196
end >>= function
11931197
| Error e ->
11941198
Log.err (fun f ->
@@ -1200,13 +1204,13 @@ struct
12001204
| Ok () -> ()
12011205
| Error e ->
12021206
Log.err (fun f -> f "failed to read TCP/IP input: %a" pp_error e);
1203-
end else if dst = c.Configuration.host_ip then begin
1207+
end else if dst = c.Configuration.host_ip && Ipaddr.V4.(compare unspecified c.Configuration.host_ip <> 0) then begin
12041208
begin
12051209
let open Lwt_result.Infix in
12061210
find_endpoint dst >>= fun endpoint ->
12071211
Log.debug (fun f ->
12081212
f "creating localhost TCP/IP proxy for %a" Ipaddr.V4.pp_hum dst);
1209-
Localhost.create clock endpoint udp_nat [ c.Configuration.host_ip ]
1213+
Localhost.create clock endpoint udp_nat localhost_ips
12101214
end >>= function
12111215
| Error e ->
12121216
Log.err (fun f ->
@@ -1225,7 +1229,7 @@ struct
12251229
Log.debug (fun f ->
12261230
f "create remote TCP/IP proxy for %a" Ipaddr.V4.pp_hum dst);
12271231
Remote.create endpoint udp_nat icmp_nat
1228-
c.Configuration.host_names [ Ipaddr.V4 c.Configuration.host_ip ]
1232+
c.Configuration.host_names localhost_ips
12291233
end >>= function
12301234
| Error e ->
12311235
Log.err (fun f ->
@@ -1465,11 +1469,10 @@ struct
14651469
Log.info (fun f -> f "Configuration %s" (Configuration.to_string c));
14661470
let global_arp_table : arp_table = {
14671471
mutex = Lwt_mutex.create();
1468-
table = [
1469-
c.Configuration.gateway_ip, c.Configuration.server_macaddr;
1470-
c.Configuration.host_ip, c.Configuration.server_macaddr;
1471-
];
1472-
1472+
table =
1473+
(c.Configuration.gateway_ip, c.Configuration.server_macaddr)
1474+
:: (if Ipaddr.V4.(compare unspecified c.Configuration.host_ip) = 0 then []
1475+
else [c.Configuration.host_ip, c.Configuration.server_macaddr ]);
14731476
} in
14741477
let client_uuids : uuid_table = {
14751478
mutex = Lwt_mutex.create();

0 commit comments

Comments
 (0)