Commit e553272d759b41e6d1de226c8fad0aab56fefdd6

Authored by bellard
1 parent 3aee288b

> 32 KB packet handling (Ed Swierk)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1891 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 5 additions and 9 deletions
slirp/ip.h
... ... @@ -75,10 +75,6 @@ typedef u_int32_t n_long; /* long as received from the net */
75 75  
76 76 /*
77 77 * Structure of an internet header, naked of options.
78   - *
79   - * We declare ip_len and ip_off to be short, rather than u_short
80   - * pragmatically since otherwise unsigned comparisons can result
81   - * against negative integers quite easily, and fail in subtle ways.
82 78 */
83 79 struct ip {
84 80 #ifdef WORDS_BIGENDIAN
... ... @@ -89,9 +85,9 @@ struct ip {
89 85 ip_v:4; /* version */
90 86 #endif
91 87 u_int8_t ip_tos; /* type of service */
92   - int16_t ip_len; /* total length */
  88 + u_int16_t ip_len; /* total length */
93 89 u_int16_t ip_id; /* identification */
94   - int16_t ip_off; /* fragment offset field */
  90 + u_int16_t ip_off; /* fragment offset field */
95 91 #define IP_DF 0x4000 /* don't fragment flag */
96 92 #define IP_MF 0x2000 /* more fragments flag */
97 93 #define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
... ... @@ -212,7 +208,7 @@ struct ipovly {
212 208 caddr32_t ih_next, ih_prev; /* for protocol sequence q's */
213 209 u_int8_t ih_x1; /* (unused) */
214 210 u_int8_t ih_pr; /* protocol */
215   - int16_t ih_len; /* protocol length */
  211 + u_int16_t ih_len; /* protocol length */
216 212 struct in_addr ih_src; /* source internet address */
217 213 struct in_addr ih_dst; /* destination internet address */
218 214 };
... ... @@ -253,9 +249,9 @@ struct ipasfrag {
253 249 u_int8_t ipf_mff; /* XXX overlays ip_tos: use low bit
254 250 * to avoid destroying tos (PPPDTRuu);
255 251 * copied from (ip_off&IP_MF) */
256   - int16_t ip_len;
  252 + u_int16_t ip_len;
257 253 u_int16_t ip_id;
258   - int16_t ip_off;
  254 + u_int16_t ip_off;
259 255 u_int8_t ip_ttl;
260 256 u_int8_t ip_p;
261 257 u_int16_t ip_sum;
... ...