| version 1.148.6.1, 2006/10/22 06:07:29 |
version 1.148.6.2, 2006/12/10 07:19:11 |
| Line 139 __KERNEL_RCSID(0, "$NetBSD$"); |
|
| Line 139 __KERNEL_RCSID(0, "$NetBSD$"); |
|
| * UDP protocol implementation. |
* UDP protocol implementation. |
| * Per RFC 768, August, 1980. |
* Per RFC 768, August, 1980. |
| */ |
*/ |
| #ifndef COMPAT_42 |
|
| int udpcksum = 1; |
int udpcksum = 1; |
| #else |
|
| int udpcksum = 0; /* XXX */ |
|
| #endif |
|
| int udp_do_loopback_cksum = 0; |
int udp_do_loopback_cksum = 0; |
| |
|
| struct inpcbtable udbtable; |
struct inpcbtable udbtable; |
|
|
| } |
} |
| |
|
| int |
int |
| udp6_input(struct mbuf **mp, int *offp, int proto __unused) |
udp6_input(struct mbuf **mp, int *offp, int proto) |
| { |
{ |
| struct mbuf *m = *mp; |
struct mbuf *m = *mp; |
| int off = *offp; |
int off = *offp; |
| Line 999 udp_ctlinput(int cmd, struct sockaddr *s |
|
| Line 995 udp_ctlinput(int cmd, struct sockaddr *s |
|
| } |
} |
| |
|
| int |
int |
| udp_ctloutput(op, so, level, optname, mp) |
udp_ctloutput(int op, struct socket *so, int level, int optname, |
| int op; |
struct mbuf **mp) |
| struct socket *so; |
|
| int level, optname; |
|
| struct mbuf **mp; |
|
| { |
{ |
| int s; |
int s; |
| int error = 0; |
int error = 0; |
| Line 1034 udp_ctloutput(op, so, level, optname, mp |
|
| Line 1027 udp_ctloutput(op, so, level, optname, mp |
|
| default: |
default: |
| error = EAFNOSUPPORT; |
error = EAFNOSUPPORT; |
| goto end; |
goto end; |
| break; |
|
| } |
} |
| |
|
| |
|
| Line 1047 udp_ctloutput(op, so, level, optname, mp |
|
| Line 1039 udp_ctloutput(op, so, level, optname, mp |
|
| case UDP_ENCAP: |
case UDP_ENCAP: |
| if (m == NULL || m->m_len < sizeof (int)) { |
if (m == NULL || m->m_len < sizeof (int)) { |
| error = EINVAL; |
error = EINVAL; |
| goto end; |
break; |
| } |
} |
| |
|
| switch(*mtod(m, int *)) { |
switch(*mtod(m, int *)) { |
| Line 1068 udp_ctloutput(op, so, level, optname, mp |
|
| Line 1060 udp_ctloutput(op, so, level, optname, mp |
|
| #endif |
#endif |
| default: |
default: |
| error = EINVAL; |
error = EINVAL; |
| goto end; |
|
| break; |
break; |
| } |
} |
| break; |
break; |
| |
|
| default: |
default: |
| error = ENOPROTOOPT; |
error = ENOPROTOOPT; |
| goto end; |
|
| break; |
break; |
| } |
} |
| |
if (m != NULL) { |
| |
m_free(m); |
| |
} |
| break; |
break; |
| |
|
| default: |
default: |
| error = EINVAL; |
error = EINVAL; |
| goto end; |
|
| break; |
break; |
| } |
} |
| |
|
| Line 1421 SYSCTL_SETUP(sysctl_net_inet_udp_setup, |
|
| Line 1413 SYSCTL_SETUP(sysctl_net_inet_udp_setup, |
|
| * -1 if an error occurent and m was freed |
* -1 if an error occurent and m was freed |
| */ |
*/ |
| static int |
static int |
| udp4_espinudp(struct mbuf **mp, int off, struct sockaddr *src __unused, |
udp4_espinudp(struct mbuf **mp, int off, struct sockaddr *src, |
| struct socket *so) |
struct socket *so) |
| { |
{ |
| size_t len; |
size_t len; |