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 | |
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).
-rw-r--r-- | cpukit/libnetworking/netinet/raw_ip.c | 9 | ||||
-rw-r--r-- | cpukit/libnetworking/netinet/tcp_subr.c | 7 |
2 files changed, 14 insertions, 2 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; } diff --git a/cpukit/libnetworking/netinet/tcp_subr.c b/cpukit/libnetworking/netinet/tcp_subr.c index 6349eeb4fc..7d657c1e21 100644 --- a/cpukit/libnetworking/netinet/tcp_subr.c +++ b/cpukit/libnetworking/netinet/tcp_subr.c @@ -592,9 +592,14 @@ tcp_ctlinput(cmd, sa, vip) else if (!PRC_IS_REDIRECT(cmd) && ((unsigned)cmd > PRC_NCMDS || inetctlerrmap[cmd] == 0)) return; - if (ip) { + if (ip != NULL) { +#ifdef _IP_VHL th = (struct tcphdr *)((caddr_t)ip + (IP_VHL_HL(ip->ip_vhl) << 2)); +#else + th = (struct tcphdr *)((caddr_t)ip + + (ip->ip_hl << 2)); +#endif in_pcbnotify(&tcb, sa, th->th_dport, ip->ip_src, th->th_sport, cmd, notify); } else |