Changeset 593 for trunk/server/source3/nmbd/nmbd_packets.c
- Timestamp:
- Jul 1, 2011, 10:18:23 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/nmbd/nmbd_packets.c
r414 r593 1697 1697 count *= 4; 1698 1698 1699 if(count > FD_SETSIZE) {1699 if(count >= FD_SETSIZE) { 1700 1700 DEBUG(0,("create_listen_fdset: Too many file descriptors needed (%d). We can \ 1701 1701 only use %d.\n", count, FD_SETSIZE)); … … 1713 1713 1714 1714 /* Add in the lp_socket_address() interface on 137. */ 1715 if (ClientNMB < 0 || ClientNMB >= FD_SETSIZE) { 1716 errno = EBADF; 1717 SAFE_FREE(pset); 1718 return True; 1719 } 1720 1715 1721 FD_SET(ClientNMB,pset); 1716 1722 sock_array[num++] = ClientNMB; … … 1722 1728 /* Add in the 137 sockets on all the interfaces. */ 1723 1729 for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec)) { 1730 if (subrec->nmb_sock < 0 || subrec->nmb_sock >= FD_SETSIZE) { 1731 /* We have to ignore sockets outside FD_SETSIZE. */ 1732 continue; 1733 } 1724 1734 FD_SET(subrec->nmb_sock,pset); 1725 1735 sock_array[num++] = subrec->nmb_sock; 1726 1736 *maxfd = MAX( *maxfd, subrec->nmb_sock); 1727 1737 1738 if (subrec->nmb_bcast < 0 || subrec->nmb_bcast >= FD_SETSIZE) { 1739 /* We have to ignore sockets outside FD_SETSIZE. */ 1740 continue; 1741 } 1728 1742 sock_array[num++] = subrec->nmb_bcast; 1729 if (subrec->nmb_bcast != -1) { 1730 FD_SET(subrec->nmb_bcast,pset); 1731 *maxfd = MAX( *maxfd, subrec->nmb_bcast); 1732 } 1743 FD_SET(subrec->nmb_bcast,pset); 1744 *maxfd = MAX( *maxfd, subrec->nmb_bcast); 1733 1745 } 1734 1746 1735 1747 /* Add in the lp_socket_address() interface on 138. */ 1748 if (ClientDGRAM < 0 || ClientDGRAM >= FD_SETSIZE) { 1749 errno = EBADF; 1750 SAFE_FREE(pset); 1751 return True; 1752 } 1736 1753 FD_SET(ClientDGRAM,pset); 1737 1754 sock_array[num++] = ClientDGRAM; … … 1743 1760 /* Add in the 138 sockets on all the interfaces. */ 1744 1761 for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec)) { 1762 if (subrec->dgram_sock < 0 || subrec->dgram_sock >= FD_SETSIZE) { 1763 /* We have to ignore sockets outside FD_SETSIZE. */ 1764 continue; 1765 } 1745 1766 FD_SET(subrec->dgram_sock,pset); 1746 1767 sock_array[num++] = subrec->dgram_sock; 1747 1768 *maxfd = MAX( *maxfd, subrec->dgram_sock); 1748 1769 1770 if (subrec->dgram_bcast < 0 || subrec->dgram_bcast >= FD_SETSIZE) { 1771 /* We have to ignore sockets outside FD_SETSIZE. */ 1772 continue; 1773 } 1749 1774 sock_array[num++] = subrec->dgram_bcast; 1750 1775 if (subrec->dgram_bcast != -1) { … … 1877 1902 #ifndef SYNC_DNS 1878 1903 dns_fd = asyncdns_fd(); 1879 if (dns_fd != -1) {1904 if (dns_fd >= 0 && dns_fd < FD_SETSIZE) { 1880 1905 FD_SET(dns_fd, &r_fds); 1881 1906 maxfd = MAX( maxfd, dns_fd);
Note:
See TracChangeset
for help on using the changeset viewer.