|
Lines 910-928
passout:
Link Here
|
| 910 |
* Even if the DONTFRAG option is specified, we cannot send the |
910 |
* Even if the DONTFRAG option is specified, we cannot send the |
| 911 |
* packet when the data length is larger than the MTU of the |
911 |
* packet when the data length is larger than the MTU of the |
| 912 |
* outgoing interface. |
912 |
* outgoing interface. |
| 913 |
* Notify the error by sending IPV6_PATHMTU ancillary data as |
913 |
* Notify the error by sending IPV6_PATHMTU ancillary data if |
| 914 |
* well as returning an error code (the latter is not described |
914 |
* application wanted to know the MTU value. Also return an |
| 915 |
* in the API spec.) |
915 |
* error code (this is not described in the API spec). |
| 916 |
*/ |
916 |
*/ |
| 917 |
u_int32_t mtu32; |
917 |
bzero(&dst_sa, sizeof(dst_sa)); |
| 918 |
struct ip6ctlparam ip6cp; |
918 |
dst_sa.sin6_family = AF_INET6; |
| 919 |
|
919 |
dst_sa.sin6_len = sizeof(dst_sa); |
| 920 |
mtu32 = (u_int32_t)mtu; |
920 |
dst_sa.sin6_addr = ip6->ip6_dst; |
| 921 |
bzero(&ip6cp, sizeof(ip6cp)); |
921 |
in6_setscope(&dst_sa.sin6_addr, origifp, NULL); |
| 922 |
ip6cp.ip6c_cmdarg = (void *)&mtu32; |
922 |
if (inp != NULL && (inp->inp_flags & IN6P_MTU) != 0 && ( |
| 923 |
pfctlinput2(PRC_MSGSIZE, (struct sockaddr *)&ro_pmtu->ro_dst, |
923 |
IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr) || |
| 924 |
(void *)&ip6cp); |
924 |
IN6_ARE_ADDR_EQUAL(&inp->in6p_faddr, &dst_sa.sin6_addr))) { |
| 925 |
|
925 |
u_int32_t mtu32 = mtu; |
|
|
926 |
/* INP_WLOCK_ASSERT(inp); */ |
| 927 |
ip6_notify_pmtu(inp, &dst_sa, &mtu32); |
| 928 |
} |
| 926 |
error = EMSGSIZE; |
929 |
error = EMSGSIZE; |
| 927 |
goto bad; |
930 |
goto bad; |
| 928 |
} |
931 |
} |