diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2007-03-29 05:21:31 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2007-03-29 05:21:31 +0000 |
commit | 7ff51b00c19ad486452c5947d10dac3fe197b03c (patch) | |
tree | f5ca6ec648622707ca7aa654ca4d9adfe3369e84 /cpukit/libnetworking/netinet/raw_ip.c | |
parent | 2007-03-29 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-7ff51b00c19ad486452c5947d10dac3fe197b03c.tar.bz2 |
Preps to eliminate _IP_VHL (Abandoned in FreeBSD).
Diffstat (limited to 'cpukit/libnetworking/netinet/raw_ip.c')
-rw-r--r-- | cpukit/libnetworking/netinet/raw_ip.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cpukit/libnetworking/netinet/raw_ip.c b/cpukit/libnetworking/netinet/raw_ip.c index 48ddf1d952..b4c4275ba6 100644 --- a/cpukit/libnetworking/netinet/raw_ip.c +++ b/cpukit/libnetworking/netinet/raw_ip.c @@ -54,9 +54,9 @@ #define _IP_VHL #include <netinet/in.h> #include <netinet/in_systm.h> -#include <netinet/ip.h> #include <netinet/in_pcb.h> #include <netinet/in_var.h> +#include <netinet/ip.h> #include <netinet/ip_var.h> #include <netinet/ip_mroute.h> @@ -198,10 +198,17 @@ rip_output(struct mbuf *m, struct socket *so, u_long dst) ip = mtod(m, struct ip *); /* don't allow both user specified and setsockopt options, and don't allow packet length sizes that will crash */ +#ifdef _IP_VHL if (((IP_VHL_HL(ip->ip_vhl) != (sizeof (*ip) >> 2)) && inp->inp_options) || (ip->ip_len > m->m_pkthdr.len) || (ip->ip_len < (IP_VHL_HL(ip->ip_vhl) << 2))) { +#else + if (((ip->ip_hl != (sizeof (*ip) >> 2)) + && inp->inp_options) + || (ip->ip_len > m->m_pkthdr.len) + || (ip->ip_len < (ip->ip_hl << 2))) { +#endif m_freem(m); return EINVAL; } |