projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
more cleanup
[unix-history]
/
usr
/
src
/
sys
/
netinet
/
ip_input.c
diff --git
a/usr/src/sys/netinet/ip_input.c
b/usr/src/sys/netinet/ip_input.c
index
8f10e58
..
9808dc1
100644
(file)
--- a/
usr/src/sys/netinet/ip_input.c
+++ b/
usr/src/sys/netinet/ip_input.c
@@
-1,12
+1,11
@@
-/* ip_input.c 1.1
4 81/11/16
*/
+/* ip_input.c 1.1
5 81/11/18
*/
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/clock.h"
#include "../h/mbuf.h"
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/clock.h"
#include "../h/mbuf.h"
-#include "../h/protocol.h"
#include "../h/protosw.h"
#include "../h/protosw.h"
-#include "../
net/inet_cksum
.h"
+#include "../
h/socket
.h"
#include "../net/inet.h"
#include "../net/inet_systm.h"
#include "../net/imp.h"
#include "../net/inet.h"
#include "../net/inet_systm.h"
#include "../net/imp.h"
@@
-53,7
+52,7
@@
struct ip *ip_reass();
ip_input(m0)
struct mbuf *m0;
{
ip_input(m0)
struct mbuf *m0;
{
- register struct ip *ip;
/* known to be r11 in CKSUM below */
+ register struct ip *ip;
register struct mbuf *m = m0;
register int i;
register struct ipq *fp;
register struct mbuf *m = m0;
register int i;
register struct ipq *fp;
@@
-69,10
+68,10
@@
COUNT(IP_INPUT);
m_freem(m);
return;
}
m_freem(m);
return;
}
-
CKSUM_IPCHK(m, ip, r11
, hlen);
+
ip->ip_sum = inet_cksum(m
, hlen);
if (ip->ip_sum) {
printf("ip_sum %x\n", ip->ip_sum);
if (ip->ip_sum) {
printf("ip_sum %x\n", ip->ip_sum);
-
netstat.ip
_badsum++;
+
ipstat.ips
_badsum++;
if (ipcksum) {
m_freem(m);
return;
if (ipcksum) {
m_freem(m);
return;
@@
-354,6
+353,7
@@
ip_drain()
{
}
{
}
+
/*
* Do option processing on a datagram,
* possibly discarding it if bad options
/*
* Do option processing on a datagram,
* possibly discarding it if bad options
@@
-364,7
+364,7
@@
ip_dooptions(ip)
{
register u_char *cp;
int opt, optlen, cnt;
{
register u_char *cp;
int opt, optlen, cnt;
- struct i
p_addr *sp
;
+ struct i
n_addr *sin
;
register struct ip_timestamp *ipt;
cp = (u_char *)(ip + 1);
register struct ip_timestamp *ipt;
cp = (u_char *)(ip + 1);
@@
-386,13
+386,13
@@
ip_dooptions(ip)
case IPOPT_SSRR:
if (cp[2] < 4 || cp[2] > optlen - (sizeof (long) - 1))
break;
case IPOPT_SSRR:
if (cp[2] < 4 || cp[2] > optlen - (sizeof (long) - 1))
break;
- s
p = (struct ip
_addr *)(cp + cp[2]);
- if (n_lhost.s_addr == *(u_long *)s
p
) {
+ s
in = (struct in
_addr *)(cp + cp[2]);
+ if (n_lhost.s_addr == *(u_long *)s
in
) {
if (opt == IPOPT_SSRR) {
/* MAKE SURE *SP DIRECTLY ACCESSIBLE */
}
if (opt == IPOPT_SSRR) {
/* MAKE SURE *SP DIRECTLY ACCESSIBLE */
}
- ip->ip_dst = *s
p
;
- *s
p
= n_lhost;
+ ip->ip_dst = *s
in
;
+ *s
in
= n_lhost;
cp[2] += 4;
}
break;
cp[2] += 4;
}
break;
@@
-406,7
+406,7
@@
ip_dooptions(ip)
goto bad;
break;
}
goto bad;
break;
}
- s
p = (struct ip
_addr *)(cp+cp[2]);
+ s
in = (struct in
_addr *)(cp+cp[2]);
switch (ipt->ipt_flg) {
case IPOPT_TS_TSONLY:
switch (ipt->ipt_flg) {
case IPOPT_TS_TSONLY:
@@
-415,11
+415,11
@@
ip_dooptions(ip)
case IPOPT_TS_TSANDADDR:
if (ipt->ipt_ptr + 8 > ipt->ipt_len)
goto bad;
case IPOPT_TS_TSANDADDR:
if (ipt->ipt_ptr + 8 > ipt->ipt_len)
goto bad;
- *(struct i
p_addr *)sp
++ = n_lhost;
+ *(struct i
n_addr *)sin
++ = n_lhost;
break;
case IPOPT_TS_PRESPEC:
break;
case IPOPT_TS_PRESPEC:
- if (*(u_long *)s
p
!= n_lhost.s_addr)
+ if (*(u_long *)s
in
!= n_lhost.s_addr)
break;
if (ipt->ipt_ptr + 8 > ipt->ipt_len)
goto bad;
break;
if (ipt->ipt_ptr + 8 > ipt->ipt_len)
goto bad;
@@
-429,7
+429,7
@@
ip_dooptions(ip)
default:
goto bad;
}
default:
goto bad;
}
- *(n_time *)s
p = ip_
time();
+ *(n_time *)s
in = ip
time();
ipt->ipt_ptr += 4;
}
}
ipt->ipt_ptr += 4;
}
}