version 1.138.2.2, 2006/12/30 20:50:34 |
version 1.151, 2006/10/12 01:32:38 |
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) |
udp6_input(struct mbuf **mp, int *offp, int proto __unused) |
{ |
{ |
struct mbuf *m = *mp; |
struct mbuf *m = *mp; |
int off = *offp; |
int off = *offp; |
Line 995 udp_ctlinput(int cmd, struct sockaddr *s |
|
Line 999 udp_ctlinput(int cmd, struct sockaddr *s |
|
} |
} |
|
|
int |
int |
udp_ctloutput(int op, struct socket *so, int level, int optname, |
udp_ctloutput(op, so, level, optname, mp) |
struct mbuf **mp) |
int op; |
|
struct socket *so; |
|
int level, optname; |
|
struct mbuf **mp; |
{ |
{ |
int s; |
int s; |
int error = 0; |
int error = 0; |
Line 1027 udp_ctloutput(int op, struct socket *so, |
|
Line 1034 udp_ctloutput(int op, struct socket *so, |
|
default: |
default: |
error = EAFNOSUPPORT; |
error = EAFNOSUPPORT; |
goto end; |
goto end; |
|
break; |
} |
} |
|
|
|
|
Line 1039 udp_ctloutput(int op, struct socket *so, |
|
Line 1047 udp_ctloutput(int op, struct socket *so, |
|
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; |
break; |
goto end; |
} |
} |
|
|
switch(*mtod(m, int *)) { |
switch(*mtod(m, int *)) { |
Line 1060 udp_ctloutput(int op, struct socket *so, |
|
Line 1068 udp_ctloutput(int op, struct socket *so, |
|
#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 1413 SYSCTL_SETUP(sysctl_net_inet_udp_setup, |
|
Line 1421 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, |
udp4_espinudp(struct mbuf **mp, int off, struct sockaddr *src __unused, |
struct socket *so) |
struct socket *so) |
{ |
{ |
size_t len; |
size_t len; |