| version 1.163.14.1, 2008/06/02 13:24:25 |
version 1.163.14.2, 2008/09/28 10:40:58 |
| Line 1000 udp_ctlinput(int cmd, const struct socka |
|
| Line 1000 udp_ctlinput(int cmd, const struct socka |
|
| } |
} |
| |
|
| int |
int |
| udp_ctloutput(int op, struct socket *so, int level, int optname, |
udp_ctloutput(int op, struct socket *so, struct sockopt *sopt) |
| struct mbuf **mp) |
|
| { |
{ |
| int s; |
int s; |
| int error = 0; |
int error = 0; |
| struct mbuf *m; |
|
| struct inpcb *inp; |
struct inpcb *inp; |
| int family; |
int family; |
| |
int optval; |
| |
|
| family = so->so_proto->pr_domain->dom_family; |
family = so->so_proto->pr_domain->dom_family; |
| |
|
| Line 1015 udp_ctloutput(int op, struct socket *so, |
|
| Line 1014 udp_ctloutput(int op, struct socket *so, |
|
| switch (family) { |
switch (family) { |
| #ifdef INET |
#ifdef INET |
| case PF_INET: |
case PF_INET: |
| if (level != IPPROTO_UDP) { |
if (sopt->sopt_level != IPPROTO_UDP) { |
| error = ip_ctloutput(op, so, level, optname, mp); |
error = ip_ctloutput(op, so, sopt); |
| goto end; |
goto end; |
| } |
} |
| break; |
break; |
| #endif |
#endif |
| #ifdef INET6 |
#ifdef INET6 |
| case PF_INET6: |
case PF_INET6: |
| if (level != IPPROTO_UDP) { |
if (sopt->sopt_level != IPPROTO_UDP) { |
| error = ip6_ctloutput(op, so, level, optname, mp); |
error = ip6_ctloutput(op, so, sopt); |
| goto end; |
goto end; |
| } |
} |
| break; |
break; |
| Line 1037 udp_ctloutput(int op, struct socket *so, |
|
| Line 1036 udp_ctloutput(int op, struct socket *so, |
|
| |
|
| switch (op) { |
switch (op) { |
| case PRCO_SETOPT: |
case PRCO_SETOPT: |
| m = *mp; |
|
| inp = sotoinpcb(so); |
inp = sotoinpcb(so); |
| |
|
| switch (optname) { |
switch (sopt->sopt_name) { |
| case UDP_ENCAP: |
case UDP_ENCAP: |
| if (m == NULL || m->m_len != sizeof(int)) { |
error = sockopt_getint(sopt, &optval); |
| error = EINVAL; |
if (error) |
| break; |
break; |
| } |
|
| |
|
| switch(*mtod(m, int *)) { |
switch(optval) { |
| #ifdef IPSEC_NAT_T |
#ifdef IPSEC_NAT_T |
| case 0: |
case 0: |
| inp->inp_flags &= ~INP_ESPINUDP_ALL; |
inp->inp_flags &= ~INP_ESPINUDP_ALL; |
| Line 1073 udp_ctloutput(int op, struct socket *so, |
|
| Line 1070 udp_ctloutput(int op, struct socket *so, |
|
| error = ENOPROTOOPT; |
error = ENOPROTOOPT; |
| break; |
break; |
| } |
} |
| if (m != NULL) { |
|
| m_free(m); |
|
| } |
|
| break; |
break; |
| |
|
| default: |
default: |