Revision: | 1.2 |
Committed: | 2006-01-17T21:19:12Z (18 years, 10 months ago) by gbeauche |
Content type: | text/plain |
Branch: | MAIN |
CVS Tags: | nigel-build-19, HEAD |
Changes since 1.1: | +9 -1 lines |
Log Message: | Packet headers can be examined through unaligned addresses. This patch fixes this, especially for MIPS & SPARC platforms. [Initial patch from Brian J. Johnson] |
# | User | Rev | Content |
---|---|---|---|
1 | gbeauche | 1.1 | /* tftp defines */ |
2 | |||
3 | #define TFTP_SESSIONS_MAX 3 | ||
4 | |||
5 | #define TFTP_SERVER 69 | ||
6 | |||
7 | #define TFTP_RRQ 1 | ||
8 | #define TFTP_WRQ 2 | ||
9 | #define TFTP_DATA 3 | ||
10 | #define TFTP_ACK 4 | ||
11 | #define TFTP_ERROR 5 | ||
12 | |||
13 | #define TFTP_FILENAME_MAX 512 | ||
14 | |||
15 | gbeauche | 1.2 | #ifdef PRAGMA_PACK_SUPPORTED |
16 | #pragma pack(1) | ||
17 | #endif | ||
18 | |||
19 | gbeauche | 1.1 | struct tftp_t { |
20 | struct ip ip; | ||
21 | struct udphdr udp; | ||
22 | u_int16_t tp_op; | ||
23 | union { | ||
24 | struct { | ||
25 | u_int16_t tp_block_nr; | ||
26 | u_int8_t tp_buf[512]; | ||
27 | } tp_data; | ||
28 | struct { | ||
29 | u_int16_t tp_error_code; | ||
30 | u_int8_t tp_msg[512]; | ||
31 | } tp_error; | ||
32 | u_int8_t tp_buf[512 + 2]; | ||
33 | } x; | ||
34 | gbeauche | 1.2 | } PACKED__; |
35 | |||
36 | #ifdef PRAGMA_PACK_SUPPORTED | ||
37 | #pragma pack(0) | ||
38 | #endif | ||
39 | gbeauche | 1.1 | |
40 | void tftp_input(struct mbuf *m); |