Deleted Added
full compact
tftp-io.c (241720) tftp-io.c (244686)
1/*
2 * Copyright (C) 2008 Edwin Groothuis. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 10 unchanged lines hidden (view full) ---

19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
1/*
2 * Copyright (C) 2008 Edwin Groothuis. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 10 unchanged lines hidden (view full) ---

19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
27__FBSDID("$FreeBSD: head/libexec/tftpd/tftp-io.c 241720 2012-10-19 05:43:38Z ed $");
27__FBSDID("$FreeBSD: head/libexec/tftpd/tftp-io.c 244686 2012-12-25 17:06:05Z antoine $");
28
29#include <sys/stat.h>
30#include <sys/types.h>
31#include <sys/socket.h>
32
33#include <netinet/in.h>
34#include <arpa/tftp.h>
35#include <arpa/inet.h>

--- 46 unchanged lines hidden (view full) ---

82 return (n); \
83 }
84
85const char *
86errtomsg(int error)
87{
88 static char ebuf[40];
89 struct errmsg *pe;
28
29#include <sys/stat.h>
30#include <sys/types.h>
31#include <sys/socket.h>
32
33#include <netinet/in.h>
34#include <arpa/tftp.h>
35#include <arpa/inet.h>

--- 46 unchanged lines hidden (view full) ---

82 return (n); \
83 }
84
85const char *
86errtomsg(int error)
87{
88 static char ebuf[40];
89 struct errmsg *pe;
90 char buf[MAXPKTSIZE];
91
92 if (error == 0)
93 return ("success");
94 for (pe = errmsgs; pe->e_code >= 0; pe++)
95 if (pe->e_code == error)
96 return (pe->e_msg);
90
91 if (error == 0)
92 return ("success");
93 for (pe = errmsgs; pe->e_code >= 0; pe++)
94 if (pe->e_code == error)
95 return (pe->e_msg);
97 snprintf(ebuf, sizeof(buf), "error %d", error);
96 snprintf(ebuf, sizeof(ebuf), "error %d", error);
98 return (ebuf);
99}
100
101static int
102send_packet(int peer, uint16_t block, char *pkt, int size)
103{
104 int i;
105 int t = 1;

--- 371 unchanged lines hidden ---
97 return (ebuf);
98}
99
100static int
101send_packet(int peer, uint16_t block, char *pkt, int size)
102{
103 int i;
104 int t = 1;

--- 371 unchanged lines hidden ---