| version 1.157, 2007/02/17 22:34:12 |
version 1.158, 2007/03/04 06:03:22 |
| Line 983 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 *)((caddr_t)ip + (ip->ip_hl << 2)); |
uh = (struct udphdr *)((char *)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 1175 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, (caddr_t)nam, |
return (in_control(so, (long)m, (void *)nam, |
| (struct ifnet *)control, l)); |
(struct ifnet *)control, l)); |
| |
|
| s = splsoftnet(); |
s = splsoftnet(); |
| Line 1417 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; |
| caddr_t data; |
void *data; |
| struct inpcb *inp; |
struct inpcb *inp; |
| size_t skip = 0; |
size_t skip = 0; |
| size_t minlen; |
size_t minlen; |
| Line 1446 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, caddr_t) + off; |
data = mtod(m, char *) + off; |
| inp = sotoinpcb(so); |
inp = sotoinpcb(so); |
| |
|
| /* Ignore keepalive packets */ |
/* Ignore keepalive packets */ |
| if ((len == 1) && (data[0] == '\xff')) { |
if ((len == 1) && (*(unsigned char *)data == 0xff)) { |
| return 1; |
return 1; |
| } |
} |
| |
|
| Line 1482 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 *)(data - skip); |
udphdr = (struct udphdr *)((char *)data - skip); |
| sport = udphdr->uh_sport; |
sport = udphdr->uh_sport; |
| dport = udphdr->uh_dport; |
dport = udphdr->uh_dport; |
| |
|
| Line 1502 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, caddr_t) + skip, mtod(m, caddr_t), iphdrlen); |
memmove(mtod(m, char *) + skip, mtod(m, void *), iphdrlen); |
| m_adj(m, skip); |
m_adj(m, skip); |
| |
|
| ip = mtod(m, struct ip *); |
ip = mtod(m, struct ip *); |