diff --git a/main.cpp b/main.cpp index cd1e9eb..4e979d6 100644 --- a/main.cpp +++ b/main.cpp @@ -39,6 +39,8 @@ static void print_help() printf("advanced options:\n"); + printf(" -b,--bind ip:port force all output packets to go through this address. Set port to 0 to use a random one.\n"); + printf(" --interface force all output packets to go through this interface.\n"); printf(" --mode fec-mode,available values: 0,1; mode 0(default) costs less bandwidth,no mtu problem.\n"); printf(" mode 1 usually introduces less latency, but you have to care about mtu.\n"); printf(" --mtu mtu for fec. for mode 0, the program will split packet to segment smaller than mtu.\n"); diff --git a/tun_dev_client.cpp b/tun_dev_client.cpp index 4f2ed3c..dc8f2c9 100644 --- a/tun_dev_client.cpp +++ b/tun_dev_client.cpp @@ -213,7 +213,7 @@ int tun_dev_client_event_loop() tun_fd=get_tun_fd(tun_dev); assert(tun_fd>0); - assert(new_connected_socket2(remote_fd,remote_addr)==0); + assert(new_connected_socket2(remote_fd,remote_addr,has_b,bind_addr,interface_string)==0); remote_fd64=fd_manager.create(remote_fd); assert(set_tun(tun_dev,htonl((ntohl(sub_net_uint32)&0xFFFFFF00)|2),htonl((ntohl(sub_net_uint32)&0xFFFFFF00 )|1),tun_mtu)==0);