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
delete OURFINNOTACKED
[unix-history]
/
usr
/
src
/
sys
/
netinet
/
udp_usrreq.c
diff --git
a/usr/src/sys/netinet/udp_usrreq.c
b/usr/src/sys/netinet/udp_usrreq.c
index
922e4cb
..
3df037f
100644
(file)
--- a/
usr/src/sys/netinet/udp_usrreq.c
+++ b/
usr/src/sys/netinet/udp_usrreq.c
@@
-1,4
+1,4
@@
-/* udp_usrreq.c 4.1
4 81/12/03
*/
+/* udp_usrreq.c 4.1
7 81/12/12
*/
#include "../h/param.h"
#include "../h/dir.h"
#include "../h/param.h"
#include "../h/dir.h"
@@
-39,7
+39,7
@@
udp_input(m0)
COUNT(UDP_INPUT);
/*
COUNT(UDP_INPUT);
/*
- * Get
ip and udp
header together in first mbuf.
+ * Get
IP and UDP
header together in first mbuf.
*/
m = m0;
if (m->m_len < sizeof (struct udpiphdr) &&
*/
m = m0;
if (m->m_len < sizeof (struct udpiphdr) &&
@@
-48,15
+48,15
@@
COUNT(UDP_INPUT);
goto bad;
}
ui = mtod(m, struct udpiphdr *);
goto bad;
}
ui = mtod(m, struct udpiphdr *);
- if (
ui->ui_len > sizeof (struct ip
))
- ip_stripoptions((struct ip *)ui, (
char
*)0);
+ if (
((struct ip *)ui)->ip_hl > (sizeof (struct ip) >> 2
))
+ ip_stripoptions((struct ip *)ui, (
struct mbuf
*)0);
/*
/*
- * Make mbuf data length reflect
udp
length.
- * If not enough data to reflect
udp
length, drop.
+ * Make mbuf data length reflect
UDP
length.
+ * If not enough data to reflect
UDP
length, drop.
*/
ulen = ntohs((u_short)ui->ui_ulen);
*/
ulen = ntohs((u_short)ui->ui_ulen);
- len = sizeof (struct udp
ip
hdr) + ulen;
+ len = sizeof (struct udphdr) + ulen;
if (((struct ip *)ui)->ip_len != len) {
if (len > ((struct ip *)ui)->ip_len) {
udpstat.udps_badlen++;
if (((struct ip *)ui)->ip_len != len) {
if (len > ((struct ip *)ui)->ip_len) {
udpstat.udps_badlen++;
@@
-67,13
+67,13
@@
COUNT(UDP_INPUT);
}
/*
}
/*
- * Checksum extended
udp
header and data.
+ * Checksum extended
UDP
header and data.
*/
if (udpcksum) {
ui->ui_next = ui->ui_prev = 0;
ui->ui_x1 = 0;
*/
if (udpcksum) {
ui->ui_next = ui->ui_prev = 0;
ui->ui_x1 = 0;
- ui->ui_len = htons((u_short)(sizeof (struct udp
ip
hdr) + ulen));
- if (
(ui->ui_sum = in_cksum(m, len)) != 0xffff
) {
+ ui->ui_len = htons((u_short)(sizeof (struct udphdr) + ulen));
+ if (
ui->ui_sum = in_cksum(m, len)
) {
udpstat.udps_badsum++;
printf("udp cksum %x\n", ui->ui_sum);
m_freem(m);
udpstat.udps_badsum++;
printf("udp cksum %x\n", ui->ui_sum);
m_freem(m);
@@
-82,7
+82,6
@@
COUNT(UDP_INPUT);
}
/*
}
/*
- * Convert addresses and ports to host format.
* Locate pcb for datagram.
*/
inp = in_pcblookup(&udb,
* Locate pcb for datagram.
*/
inp = in_pcblookup(&udb,
@@
-111,11
+110,9
@@
udp_ctlinput(m)
{
COUNT(UDP_CTLINPUT);
{
COUNT(UDP_CTLINPUT);
- printf("udp_ctlinput\n");
m_freem(m);
}
m_freem(m);
}
-/*ARGSUSED*/
udp_output(inp, m0)
struct inpcb *inp;
struct mbuf *m0;
udp_output(inp, m0)
struct inpcb *inp;
struct mbuf *m0;
@@
-127,7
+124,7
@@
udp_output(inp, m0)
COUNT(UDP_OUTPUT);
/*
* Calculate data length and get a mbuf
COUNT(UDP_OUTPUT);
/*
* Calculate data length and get a mbuf
- * for
udp and ip
headers.
+ * for
UDP and IP
headers.
*/
for (m = m0; m; m = m->m_next)
len += m->m_len;
*/
for (m = m0; m; m = m->m_next)
len += m->m_len;
@@
-136,7
+133,7
@@
COUNT(UDP_OUTPUT);
goto bad;
/*
goto bad;
/*
- * Fill in mbuf with extended
udp
header
+ * Fill in mbuf with extended
UDP
header
* and addresses and length put into network format.
*/
m->m_off = MMAXOFF - sizeof (struct udpiphdr);
* and addresses and length put into network format.
*/
m->m_off = MMAXOFF - sizeof (struct udpiphdr);
@@
-166,7
+163,6
@@
bad:
m_freem(m);
}
m_freem(m);
}
-/*ARGSUSED*/
udp_usrreq(so, req, m, addr)
struct socket *so;
int req;
udp_usrreq(so, req, m, addr)
struct socket *so;
int req;