Changeset 578 for branches/samba-3.3.x/source/nmbd/nmbd_packets.c
- Timestamp:
- Jun 25, 2011, 7:14:41 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/nmbd/nmbd_packets.c
r206 r578 1684 1684 count++; 1685 1685 1686 if((count*2) + 2 > FD_SETSIZE) {1686 if((count*2) + 2 >= FD_SETSIZE) { 1687 1687 DEBUG(0,("create_listen_fdset: Too many file descriptors needed (%d). We can \ 1688 1688 only use %d.\n", (count*2) + 2, FD_SETSIZE)); … … 1700 1700 1701 1701 /* Add in the broadcast socket on 137. */ 1702 if (ClientNMB < 0 || ClientNMB >= FD_SETSIZE) { 1703 errno = EBADF; 1704 SAFE_FREE(pset); 1705 return True; 1706 } 1707 1702 1708 FD_SET(ClientNMB,pset); 1703 1709 sock_array[num++] = ClientNMB; … … 1706 1712 /* Add in the 137 sockets on all the interfaces. */ 1707 1713 for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec)) { 1714 if (subrec->nmb_sock < 0 || subrec->nmb_sock >= FD_SETSIZE) { 1715 /* We have to ignore sockets outside FD_SETSIZE. */ 1716 continue; 1717 } 1708 1718 FD_SET(subrec->nmb_sock,pset); 1709 1719 sock_array[num++] = subrec->nmb_sock; … … 1712 1722 1713 1723 /* Add in the broadcast socket on 138. */ 1724 if (ClientDGRAM < 0 || ClientDGRAM >= FD_SETSIZE) { 1725 errno = EBADF; 1726 SAFE_FREE(pset); 1727 return True; 1728 } 1729 1714 1730 FD_SET(ClientDGRAM,pset); 1715 1731 sock_array[num++] = ClientDGRAM; … … 1718 1734 /* Add in the 138 sockets on all the interfaces. */ 1719 1735 for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec)) { 1736 if (subrec->dgram_sock < 0 || subrec->dgram_sock >= FD_SETSIZE) { 1737 /* We have to ignore sockets outside FD_SETSIZE. */ 1738 continue; 1739 } 1720 1740 FD_SET(subrec->dgram_sock,pset); 1721 1741 sock_array[num++] = subrec->dgram_sock; … … 1768 1788 #ifndef SYNC_DNS 1769 1789 dns_fd = asyncdns_fd(); 1770 if (dns_fd != -1) {1790 if (dns_fd >= 0 && dns_fd < FD_SETSIZE) { 1771 1791 FD_SET(dns_fd, &r_fds); 1772 1792 maxfd = MAX( maxfd, dns_fd);
Note:
See TracChangeset
for help on using the changeset viewer.