Protocol structure can now specify the default port.

This commit is contained in:
Michael Brown
2005-05-01 23:57:09 +00:00
parent 63482e4fe9
commit f14af3d95c
5 changed files with 14 additions and 13 deletions
+3 -3
View File
@@ -50,8 +50,6 @@ int tftp_block ( struct tftpreq_info_t *request,
blksize = TFTP_DEFAULTSIZE_PACKET;
lport++; /* Use new local port */
server = *(request->server);
if ( ! server.sin_port )
server.sin_port = TFTP_PORT;
if ( !udp_transmit(server.sin_addr.s_addr, lport,
server.sin_port, xmitlen, &xmit) )
return (0);
@@ -170,5 +168,7 @@ int tftp ( char *url __unused,
}
struct protocol tftp_protocol __default_protocol = {
"tftp", tftp
.name = "tftp",
.default_port = TFTP_PORT,
.load = tftp,
};