| version 1.156.4.3, 2007/05/17 13:41:51 |
version 1.157, 2007/02/17 22:34:12 |
| Line 384 udp_input(struct mbuf *m, ...) |
|
| Line 384 udp_input(struct mbuf *m, ...) |
|
| goto badcsum; |
goto badcsum; |
| |
|
| /* construct source and dst sockaddrs. */ |
/* construct source and dst sockaddrs. */ |
| sockaddr_in_init(&src, &ip->ip_src, uh->uh_sport); |
bzero(&src, sizeof(src)); |
| sockaddr_in_init(&dst, &ip->ip_dst, uh->uh_dport); |
src.sin_family = AF_INET; |
| |
src.sin_len = sizeof(struct sockaddr_in); |
| |
bcopy(&ip->ip_src, &src.sin_addr, sizeof(src.sin_addr)); |
| |
src.sin_port = uh->uh_sport; |
| |
bzero(&dst, sizeof(dst)); |
| |
dst.sin_family = AF_INET; |
| |
dst.sin_len = sizeof(struct sockaddr_in); |
| |
bcopy(&ip->ip_dst, &dst.sin_addr, sizeof(dst.sin_addr)); |
| |
dst.sin_port = uh->uh_dport; |
| |
|
| if ((n = udp4_realinput(&src, &dst, &m, iphlen)) == -1) { |
if ((n = udp4_realinput(&src, &dst, &m, iphlen)) == -1) { |
| udpstat.udps_hdrops++; |
udpstat.udps_hdrops++; |
| Line 975 udp_ctlinput(int cmd, const struct socka |
|
| Line 983 udp_ctlinput(int cmd, const struct socka |
|
| else if (errno == 0) |
else if (errno == 0) |
| return NULL; |
return NULL; |
| if (ip) { |
if (ip) { |
| uh = (struct udphdr *)((char *)ip + (ip->ip_hl << 2)); |
uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2)); |
| in_pcbnotify(&udbtable, satocsin(sa)->sin_addr, uh->uh_dport, |
in_pcbnotify(&udbtable, satocsin(sa)->sin_addr, uh->uh_dport, |
| ip->ip_src, uh->uh_sport, errno, notify); |
ip->ip_src, uh->uh_sport, errno, notify); |
| |
|
| Line 1167 udp_usrreq(struct socket *so, int req, s |
|
| Line 1175 udp_usrreq(struct socket *so, int req, s |
|
| int error = 0; |
int error = 0; |
| |
|
| if (req == PRU_CONTROL) |
if (req == PRU_CONTROL) |
| return (in_control(so, (long)m, (void *)nam, |
return (in_control(so, (long)m, (caddr_t)nam, |
| (struct ifnet *)control, l)); |
(struct ifnet *)control, l)); |
| |
|
| s = splsoftnet(); |
s = splsoftnet(); |
| Line 1409 udp4_espinudp(struct mbuf **mp, int off, |
|
| Line 1417 udp4_espinudp(struct mbuf **mp, int off, |
|
| struct socket *so) |
struct socket *so) |
| { |
{ |
| size_t len; |
size_t len; |
| void *data; |
caddr_t data; |
| struct inpcb *inp; |
struct inpcb *inp; |
| size_t skip = 0; |
size_t skip = 0; |
| size_t minlen; |
size_t minlen; |
| Line 1438 udp4_espinudp(struct mbuf **mp, int off, |
|
| Line 1446 udp4_espinudp(struct mbuf **mp, int off, |
|
| } |
} |
| |
|
| len = m->m_len - off; |
len = m->m_len - off; |
| data = mtod(m, char *) + off; |
data = mtod(m, caddr_t) + off; |
| inp = sotoinpcb(so); |
inp = sotoinpcb(so); |
| |
|
| /* Ignore keepalive packets */ |
/* Ignore keepalive packets */ |
| if ((len == 1) && (*(unsigned char *)data == 0xff)) { |
if ((len == 1) && (data[0] == '\xff')) { |
| return 1; |
return 1; |
| } |
} |
| |
|
| Line 1474 udp4_espinudp(struct mbuf **mp, int off, |
|
| Line 1482 udp4_espinudp(struct mbuf **mp, int off, |
|
| * Get the UDP ports. They are handled in network |
* Get the UDP ports. They are handled in network |
| * order everywhere in IPSEC_NAT_T code. |
* order everywhere in IPSEC_NAT_T code. |
| */ |
*/ |
| udphdr = (struct udphdr *)((char *)data - skip); |
udphdr = (struct udphdr *)(data - skip); |
| sport = udphdr->uh_sport; |
sport = udphdr->uh_sport; |
| dport = udphdr->uh_dport; |
dport = udphdr->uh_dport; |
| |
|
| Line 1494 udp4_espinudp(struct mbuf **mp, int off, |
|
| Line 1502 udp4_espinudp(struct mbuf **mp, int off, |
|
| * <-skip-> |
* <-skip-> |
| */ |
*/ |
| iphdrlen = off - sizeof(struct udphdr); |
iphdrlen = off - sizeof(struct udphdr); |
| memmove(mtod(m, char *) + skip, mtod(m, void *), iphdrlen); |
memmove(mtod(m, caddr_t) + skip, mtod(m, caddr_t), iphdrlen); |
| m_adj(m, skip); |
m_adj(m, skip); |
| |
|
| ip = mtod(m, struct ip *); |
ip = mtod(m, struct ip *); |