diff options
author | Thomas Osterried <thomas@osterried.de> | 2013-09-15 16:16:41 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-05-02 18:07:47 +0200 |
commit | 32b610a198d65d9e9bc2debddaa348dc231d1759 (patch) | |
tree | 189a4ee131905643f8b7c14d90b4efd23d163106 /ax25ipd/io.c | |
parent | b42643f4ed8084203cf6ef5fc857997e06df24ce (diff) |
Fix accidental termination of ax25ipd.
ax25ipd sometimes terminated ("normaly") when the remote site (or
a router on the way) sent an icmp unreachable.
That's a problem with a positive error list (where every unknown
error is interpreted as major problem); this makes the code
unstable whenever new errno's are implemented in newer kernels..
Signed-off-by: Thomas Osterried <thomas@osterried.de>
Diffstat (limited to 'ax25ipd/io.c')
-rw-r--r-- | ax25ipd/io.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ax25ipd/io.c b/ax25ipd/io.c index 4277612..a293d69 100644 --- a/ax25ipd/io.c +++ b/ax25ipd/io.c @@ -620,6 +620,16 @@ int io_error( fprintf (stderr, "message was %d bytes long.\n", bufsize); return 0; } + if (errno == ENETDOWN || errno == ENETRESET || + errno == ENETUNREACH || errno == EHOSTDOWN || + errno == EHOSTUNREACH || errno == ENONET || + errno == EPERM) { + /* host closed his axip receiver or dropped the line */ + perror("error after sending on to axip partner. ignoring."); + LOGL4("error after sending on to axip partner: %s; ignoring!\n", strerror(errno)); + + return 0; + } if (errno == ENOBUFS) { /* congestion; sleep + retry */ LOGL4("send congestion on raw ip, sleeping and retrying!\n"); usleep(100000); @@ -638,6 +648,16 @@ int io_error( fprintf(stderr, "message was %d bytes long.\n", bufsize); return 0; } + if (errno == ENETDOWN || errno == ENETRESET || + errno == ENETUNREACH || errno == EHOSTDOWN || + errno == EHOSTUNREACH || errno == ENONET || + errno == EPERM) { + /* host closed his axudp receiver or dropped the line */ + perror("error after sending to axudp partner. ignoring."); + LOGL4("error after sending to axudp partner: %s; ignoring!\n", strerror(errno)); + + return 0; + } if (errno == ENOBUFS) { /* congestion; sleep + retry */ LOGL4("send congestion on udp, sleeping and retrying!\n"); usleep(100000); |