aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-05-02 21:09:02 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-05-02 21:09:02 +0000
commiteacc9a9a94dba8540c4d126a27fd0b229521a9f5 (patch)
treeec683d47aeb1c8ff2bf64a2e3e051b1d8db281b5
parent770e4c3398bf5d477fddc2702e5d884026ada1fa (diff)
downloadslirp-eacc9a9a94dba8540c4d126a27fd0b229521a9f5.zip
slirp-eacc9a9a94dba8540c4d126a27fd0b229521a9f5.tar.gz
slirp-eacc9a9a94dba8540c4d126a27fd0b229521a9f5.tar.bz2
> 32 KB packet handling (Ed Swierk)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1891 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--ip.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/ip.h b/ip.h
index 3fe4469..b7bb9b9 100644
--- a/ip.h
+++ b/ip.h
@@ -75,10 +75,6 @@ typedef u_int32_t n_long; /* long as received from the net */
/*
* Structure of an internet header, naked of options.
- *
- * We declare ip_len and ip_off to be short, rather than u_short
- * pragmatically since otherwise unsigned comparisons can result
- * against negative integers quite easily, and fail in subtle ways.
*/
struct ip {
#ifdef WORDS_BIGENDIAN
@@ -89,9 +85,9 @@ struct ip {
ip_v : 4; /* version */
#endif
u_int8_t ip_tos; /* type of service */
- int16_t ip_len; /* total length */
+ u_int16_t ip_len; /* total length */
u_int16_t ip_id; /* identification */
- int16_t ip_off; /* fragment offset field */
+ u_int16_t ip_off; /* fragment offset field */
#define IP_DF 0x4000 /* don't fragment flag */
#define IP_MF 0x2000 /* more fragments flag */
#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
@@ -212,7 +208,7 @@ struct ipovly {
caddr32_t ih_next, ih_prev; /* for protocol sequence q's */
u_int8_t ih_x1; /* (unused) */
u_int8_t ih_pr; /* protocol */
- int16_t ih_len; /* protocol length */
+ u_int16_t ih_len; /* protocol length */
struct in_addr ih_src; /* source internet address */
struct in_addr ih_dst; /* destination internet address */
};
@@ -251,9 +247,9 @@ struct ipasfrag {
u_int8_t ipf_mff; /* XXX overlays ip_tos: use low bit
* to avoid destroying tos (PPPDTRuu);
* copied from (ip_off&IP_MF) */
- int16_t ip_len;
+ u_int16_t ip_len;
u_int16_t ip_id;
- int16_t ip_off;
+ u_int16_t ip_off;
u_int8_t ip_ttl;
u_int8_t ip_p;
u_int16_t ip_sum;