diff options
Diffstat (limited to 'busybox/networking')
-rw-r--r-- | busybox/networking/nc.c | 7 | ||||
-rw-r--r-- | busybox/networking/traceroute.c | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/busybox/networking/nc.c b/busybox/networking/nc.c index ab8ec0c..6ce85fe 100644 --- a/busybox/networking/nc.c +++ b/busybox/networking/nc.c @@ -161,8 +161,11 @@ int nc_main(int argc, char **argv) exit(0); ofd = STDOUT_FILENO; } else { - if (nread == 0) - shutdown(sfd, 1); + if (nread <= 0) { + shutdown(sfd, 1 /* send */ ); + close(STDIN_FILENO); + FD_CLR(STDIN_FILENO, &readfds); + } ofd = sfd; } diff --git a/busybox/networking/traceroute.c b/busybox/networking/traceroute.c index 44ffdf0..cf90ec0 100644 --- a/busybox/networking/traceroute.c +++ b/busybox/networking/traceroute.c @@ -101,7 +101,8 @@ struct opacket { #include "busybox.h" -static u_char packet[512]; /* last inbound (icmp) packet */ + /* last inbound (icmp) packet */ +static u_char packet[512] __attribute__ ((aligned)); static struct opacket *outpacket; /* last output (udp) packet */ static int s; /* receive (icmp) socket file descriptor */ |