Deleted Added
full compact
tftp-io.c (244686) tftp-io.c (246106)
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 244686 2012-12-25 17:06:05Z antoine $");
27__FBSDID("$FreeBSD: head/libexec/tftpd/tftp-io.c 246106 2013-01-30 01:36:04Z sbruno $");
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>

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

137send_error(int peer, int error)
138{
139 struct tftphdr *tp;
140 int length;
141 struct errmsg *pe;
142 char buf[MAXPKTSIZE];
143
144 if (debug&DEBUG_PACKETS)
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>

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

137send_error(int peer, int error)
138{
139 struct tftphdr *tp;
140 int length;
141 struct errmsg *pe;
142 char buf[MAXPKTSIZE];
143
144 if (debug&DEBUG_PACKETS)
145 tftp_log(LOG_DEBUG, "Sending ERROR %d: %s", error);
145 tftp_log(LOG_DEBUG, "Sending ERROR %d", error);
146
147 DROPPACKET("send_error");
148
149 tp = (struct tftphdr *)buf;
150 tp->th_opcode = htons((u_short)ERROR);
151 tp->th_code = htons((u_short)error);
152 for (pe = errmsgs; pe->e_code >= 0; pe++)
153 if (pe->e_code == error)

--- 322 unchanged lines hidden ---
146
147 DROPPACKET("send_error");
148
149 tp = (struct tftphdr *)buf;
150 tp->th_opcode = htons((u_short)ERROR);
151 tp->th_code = htons((u_short)error);
152 for (pe = errmsgs; pe->e_code >= 0; pe++)
153 if (pe->e_code == error)

--- 322 unchanged lines hidden ---