John Hood
dfdfa5d9b0
FreeBSD TOS issues
2016-05-14 00:05:41 -04:00
John Hood
7af87d85cc
Remove redundant stringification for decrypt().
2016-03-30 23:52:19 -04:00
John Hood
c964d40dd8
Do not throw from destructors, fatal_assert() instead.
2016-03-30 23:52:19 -04:00
John Hood
255dc39c9f
Factor encrypt/decrypt out of Network::Message.
2016-03-30 23:52:19 -04:00
John Hood
6abd4739de
Const correctness and const-ref in Crypto and elsewhere.
2016-03-30 23:52:19 -04:00
John Hood
13928e9c10
Use a secure counter for OCB's nonce. Protect nonce in Network::Packet.
2016-03-30 23:52:19 -04:00
John Hood
60e3d380b8
Fix Cygwin compile warning.
2016-01-16 12:56:39 -05:00
John Hood
3fa42cb8bb
Support different IPv4 and IPv6 MTUs.
...
Closes #688 .
2015-11-29 10:31:17 -05:00
John Hood
310b899a23
Support older getaddrinfo() missing AI_NUMERICSERV
...
Define this flag as 0 if unavailable.
This is needed for my OS X 10.5 system.
Signed-off-by: John Hood <cgull@glup.org >
2015-06-21 16:14:41 -04:00
Geoffrey Thomas
aeffb71cfc
Style cleanup: "foo &x", not "foo& x"
2015-06-04 23:47:32 -04:00
Geoffrey Thomas
5721b392ab
Make all exception classes inherit from std::exception
...
This refactors out a very common pattern of formatting "%s: %s" with
e.function.c_str() and strerror( e.the_errno ) into just the what()
method of NetworkException. It's also a prerequisite for making cleaner
public API for any exceptions we throw, and allows us to more easily
get exceptions passed back to us to handle.
2015-06-04 23:47:31 -04:00
Anders Kaseorg
7c942e6836
Connection::try_bind: Pass port argument 0 as a string
...
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
2014-01-04 04:31:30 -05:00
Anders Kaseorg
b39da20edc
AddrInfo: Fix error message generation when node == NULL
...
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
2014-01-04 04:31:30 -05:00
Anders Kaseorg
5532117984
Revert "Fix mosh-server segfault on startup when run without arguments"
...
This reverts commit 578db45fbf .
The NULL inputs to getaddrinfo are valid in certain cases, and at
least in the case of node, important. The segfault happens not with
getaddrinfo, but with the error message generation below it.
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
2014-01-04 04:31:02 -05:00
Keith Winstein
578db45fbf
Fix mosh-server segfault on startup when run without arguments
2014-01-04 03:08:57 -05:00
Keith Winstein
27678941d4
network.cc: Properly close old fd on Socket assignment operator
...
Fix thanks to Igor Bukanov. Closes #470 .
2014-01-04 02:51:37 -05:00
Anders Kaseorg
553918d3f2
Connection: Support IPv6 addresses
...
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
2013-08-17 09:02:44 -04:00
Anders Kaseorg
110cce3773
Connection: Move socket creation out of setup
...
Once we support IPv6, we won’t be able to create a socket until we
know which address family to use.
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
2013-08-17 08:58:16 -04:00
Anders Kaseorg
c1f96b37a1
Connection: Store the port number as a string
...
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
2013-08-17 08:26:30 -04:00
Keith Winstein
1bd38e6dab
Include sys/uio.h to fix OpenBSD build problem ( closes #391 )
2013-03-10 16:58:16 -04:00
Keith Winstein
770e4208cc
DiffServ codepoint and ECN: Roll back to just ECT (no DSCP)
2013-03-10 16:41:44 -04:00
Anders Kaseorg
866e1399d5
Socket::operator=: Return non-const reference
...
Found by cppcheck.
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
2013-03-10 15:48:08 -04:00
Anders Kaseorg
5365d6b21d
Connection::recv: Rethrow the original exception instead of a copy
...
Found by cppcheck.
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
2013-03-10 15:48:08 -04:00
Anton Lundin
99dc1f93cf
Use MSG_NONBLOCK when MSG_DONTWAIT doesn't exist
2012-12-01 14:49:29 +01:00
Keith Winstein
6a16eecce0
Use dup() instead of move semantics for Network::Socket
2012-11-23 13:31:23 -05:00
Luke Mewburn
141ec239da
Support port range as -p/--port PORT[:HIGHPORT].
...
Extend mosh and mosh-server to support parsing a high port from
the desired_port argument. The first (low) port must not be
greater than the second (high) port.
If only one value is provided, behaviour is as before; bind
to one port. Also tweak the formatting in mosh-server(1) synopsis
to be consistent.
This resolves mosh issue # 296.
Signed-off-by: Luke Mewburn <luke@mewburn.net >
2012-10-29 14:59:28 -04:00
Keith Winstein
b99da057bb
Back out use of ip.h IPTOS_DSCP_AF42 constant (missing on OS X)
2012-10-22 10:50:28 -04:00
Keith Winstein
c53a174d0c
Revert "Check for netinet/ip.h (now that we are using it), and don't also use in.h"
...
This reverts commit 0909ea55d6 .
2012-10-22 10:50:07 -04:00
Keith Winstein
0909ea55d6
Check for netinet/ip.h (now that we are using it), and don't also use in.h
2012-10-22 10:34:16 -04:00
olgeni
2e39dbc977
Fix calls to setsockopt.
...
On FreeBSD, the socket option length must be declared as an int.
While I'm here, translate dscp (0x92) to the appropriate constants.
(tested on FreeBSD only so far)
2012-10-22 14:29:39 +02:00
Keith Winstein
39276a46ad
More conservative default MTU, and react to MSGSIZE
2012-10-16 17:46:05 -04:00
Keith Winstein
be3b1259b6
Make sendto() non-blocking
2012-10-16 17:40:02 -04:00
Keith Winstein
c0092a6e7e
Hop new ports, but keep the old [for a minute, and up to 10 at a time]
...
(One is silver and the other gold...)
2012-10-05 02:51:25 -04:00
Keith Winstein
9eb9a0386e
Warn on congestion
2012-10-04 21:47:58 -04:00
Keith Winstein
9ac3b65090
Respond to explicit congestion notification (slow down sender)
2012-09-28 19:07:31 -04:00
Keith Winstein
815aff9a73
Don't assert has_remote_addr, because can change between fragments.
2012-08-15 23:58:21 +03:00
Keith Winstein
5376ed1996
Use end-to-end-to-end connectivity (in transport layer) to control port hop.
...
Avoid playing games with network-layer timestamps.
2012-08-13 16:48:25 +03:00
Keith Winstein
a21fed3dca
Remove automatic hopping triggers from SSP.
2012-08-13 14:59:20 +03:00
Keith Winstein
82830344ca
Hop ports when missing E2E2E connectivity, even if downlink working.
2012-08-13 14:26:53 +03:00
Keith Winstein
89da6105aa
When not connected, (1) client hops port numbers (2) server stops sending.
2012-08-13 11:19:25 +03:00
Timo Sirainen
620152261e
Don't use s_addr as parameter name. Fixes compiling with Solaris.
...
Signed-off-by: Timo Sirainen <tss@iki.fi >
2012-08-11 17:14:44 -04:00
Keith Winstein
a744004bf6
Get system timestamp less often (only after sleeping/selecting)
2012-07-26 21:13:26 -04:00
Keith Winstein
92ecb99b71
Add OpenSSL licensing exception
2012-07-20 16:46:00 -04:00
Alexander Chernyakhovsky
0099f080ad
Fix FTBFS on ARM on GCC 4.7.0
...
GCC v4.7.0, as found in Fedora 17 and newer, fails to build mosh on
ARM because of a narrowing warning, which is then promoted to an error
by -Werror. This error message is new, and did not occur under
previous versions of GCC.
This patch corrects this error by explicitly casting to the desired
datatype the return value of the offending code, the result of a macro
from glibc to implement htobe16().
2012-06-20 01:24:08 -04:00
Keith Winstein
88bed3e94a
Remove warning for IP_TOS failure
2012-06-12 14:39:36 -04:00
Keith Winstein
37f78d0e4c
Disable out-of-order warning (fires too much on some 802.11n networks)
...
This reverts commit 682bbdfebd .
2012-05-30 02:04:32 -04:00
Keith Winstein
ade0aaa3e8
Make IP_TOS failure non-fatal per Keegan.
2012-05-25 21:00:51 -04:00
Dave Taht
72e6c85e3d
Set diffserv values to AF42 + ECT
...
AF42 has both the properties of CS42 and the IMM bit.
Whether this has the advantages or disadvantages of just one or
the other, I don't know. With most mac80211 stacks this will
force mosh packets in the VI queue on wireless.
As for pfifo_fast, have to look it up...
2012-05-25 20:40:49 -04:00
Keith Winstein
682bbdfebd
Warn on out-of-order or duplicated packets (or missing nonce increment!)
2012-05-23 18:08:31 -04:00
Keegan McAllister
67a85eaf99
Deliver sendto() exceptions without disturbing control flow
...
This prevents the client from waking up every 200 ms while the network is down.
Addresses #243 .
2012-05-09 14:19:46 -04:00