aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-10-28 17:48:15 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-10-28 17:48:15 +0200
commit1e98f3741c5a844c1d3d7966f20cd09dded05d0d (patch)
tree6044a3e180389e63c55173f5018bf2ddaa195cd6 /networking
parented058016bf8fc98271de2e58bfb650de9e9d304d (diff)
downloadbusybox-w32-1e98f3741c5a844c1d3d7966f20cd09dded05d0d.tar.gz
busybox-w32-1e98f3741c5a844c1d3d7966f20cd09dded05d0d.tar.bz2
busybox-w32-1e98f3741c5a844c1d3d7966f20cd09dded05d0d.zip
Apply post-1.19.2 patches, bump version to 1.19.31_19_3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r--networking/inetd.c14
-rw-r--r--networking/tftp.c3
2 files changed, 12 insertions, 5 deletions
diff --git a/networking/inetd.c b/networking/inetd.c
index 873fd9528..05ad8c792 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -1278,6 +1278,7 @@ int inetd_main(int argc UNUSED_PARAM, char **argv)
1278 sep->se_count = 0; 1278 sep->se_count = 0;
1279 rearm_alarm(); /* will revive it in RETRYTIME sec */ 1279 rearm_alarm(); /* will revive it in RETRYTIME sec */
1280 restore_sigmask(&omask); 1280 restore_sigmask(&omask);
1281 maybe_close(new_udp_fd);
1281 maybe_close(accepted_fd); 1282 maybe_close(accepted_fd);
1282 continue; /* -> check next fd in fd set */ 1283 continue; /* -> check next fd in fd set */
1283 } 1284 }
@@ -1298,17 +1299,18 @@ int inetd_main(int argc UNUSED_PARAM, char **argv)
1298 bb_perror_msg("vfork"+1); 1299 bb_perror_msg("vfork"+1);
1299 sleep(1); 1300 sleep(1);
1300 restore_sigmask(&omask); 1301 restore_sigmask(&omask);
1302 maybe_close(new_udp_fd);
1301 maybe_close(accepted_fd); 1303 maybe_close(accepted_fd);
1302 continue; /* -> check next fd in fd set */ 1304 continue; /* -> check next fd in fd set */
1303 } 1305 }
1304 if (pid == 0) 1306 if (pid == 0)
1305 pid--; /* -1: "we did fork and we are child" */ 1307 pid--; /* -1: "we did fork and we are child" */
1306 } 1308 }
1307 /* if pid == 0 here, we never forked */ 1309 /* if pid == 0 here, we didn't fork */
1308 1310
1309 if (pid > 0) { /* parent */ 1311 if (pid > 0) { /* parent */
1310 if (sep->se_wait) { 1312 if (sep->se_wait) {
1311 /* tcp wait: we passed listening socket to child, 1313 /* wait: we passed socket to child,
1312 * will wait for child to terminate */ 1314 * will wait for child to terminate */
1313 sep->se_wait = pid; 1315 sep->se_wait = pid;
1314 remove_fd_from_set(sep->se_fd); 1316 remove_fd_from_set(sep->se_fd);
@@ -1345,9 +1347,13 @@ int inetd_main(int argc UNUSED_PARAM, char **argv)
1345 setsid(); 1347 setsid();
1346 /* "nowait" udp */ 1348 /* "nowait" udp */
1347 if (new_udp_fd >= 0) { 1349 if (new_udp_fd >= 0) {
1348 len_and_sockaddr *lsa = xzalloc_lsa(sep->se_family); 1350 len_and_sockaddr *lsa;
1351 int r;
1352
1353 close(new_udp_fd);
1354 lsa = xzalloc_lsa(sep->se_family);
1349 /* peek at the packet and remember peer addr */ 1355 /* peek at the packet and remember peer addr */
1350 int r = recvfrom(ctrl, NULL, 0, MSG_PEEK|MSG_DONTWAIT, 1356 r = recvfrom(ctrl, NULL, 0, MSG_PEEK|MSG_DONTWAIT,
1351 &lsa->u.sa, &lsa->len); 1357 &lsa->u.sa, &lsa->len);
1352 if (r < 0) 1358 if (r < 0)
1353 goto do_exit1; 1359 goto do_exit1;
diff --git a/networking/tftp.c b/networking/tftp.c
index 17485a527..043b879af 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -813,7 +813,8 @@ int tftpd_main(int argc UNUSED_PARAM, char **argv)
813 goto err; 813 goto err;
814 } 814 }
815 mode = local_file + strlen(local_file) + 1; 815 mode = local_file + strlen(local_file) + 1;
816 if (mode >= block_buf + result || strcmp(mode, "octet") != 0) { 816 /* RFC 1350 says mode string is case independent */
817 if (mode >= block_buf + result || strcasecmp(mode, "octet") != 0) {
817 goto err; 818 goto err;
818 } 819 }
819# if ENABLE_FEATURE_TFTP_BLOCKSIZE 820# if ENABLE_FEATURE_TFTP_BLOCKSIZE