1 diff -urN atftp.old/tftp.c atftp.dev/tftp.c
2 --- atftp.old/tftp.c 2004-03-16 00:55:56.000000000 +0100
3 +++ atftp.dev/tftp.c 2006-03-22 10:18:54.000000000 +0100
5 int set_peer(int argc, char **argv)
7 struct hostent *host; /* for host name lookup */
8 - struct servent *sp; /* server entry for tftp service */
9 + int port = htons(69);
12 if ((argc < 2) || (argc > 3))
17 - /* get the server entry */
18 - sp = getservbyname("tftp", "udp");
20 - fprintf(stderr, "tftp: udp/tftp, unknown service.\n");
24 /* look up the host */
25 host = gethostbyname(argv[1]);
26 /* if valid, update s_inn structure */
28 Strncpy(data.hostname, host->h_name,
29 sizeof(data.hostname));
30 data.hostname[sizeof(data.hostname)-1] = 0;
31 - data.sa_peer.sin_port = sp->s_port;
32 + data.sa_peer.sin_port = port;
37 /* get the server port */
40 - sp->s_port = htons(atoi(argv[2]));
42 + port = htons(atoi(argv[2]));
45 fprintf(stderr, "%s: bad port number.\n", argv[2]);
49 - data.sa_peer.sin_port = sp->s_port;
50 + data.sa_peer.sin_port = port;
52 /* copy port number to data structure */
53 - data.port = ntohs(sp->s_port);
54 + data.port = ntohs(port);
58 diff -urN atftp.old/tftpd.c atftp.dev/tftpd.c
59 --- atftp.old/tftpd.c 2004-02-27 03:05:26.000000000 +0100
60 +++ atftp.dev/tftpd.c 2006-03-22 10:23:20.000000000 +0100
66 - if ((serv = getservbyname("tftp", "udp")) == NULL)
68 - logger(LOG_ERR, "atftpd: udp/tftp, unknown service");
71 - tftpd_port = ntohs(serv->s_port);
73 + tftpd_port = htons(69);
75 /* initialise sockaddr_in structure */
76 memset(&sa, 0, sizeof(sa));
77 sa.sin_family = AF_INET;