summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6_pcb.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2004-02-13 14:50:01 +0000
committerume <ume@FreeBSD.org>2004-02-13 14:50:01 +0000
commitf35565e63f9461f81b17f432764b5ca25e02856c (patch)
treef952cbefcf8a041f874d6e06257be2836aede356 /sys/netinet6/in6_pcb.c
parent326680c1492004585de0fab05ad78cb474e6f539 (diff)
downloadFreeBSD-src-f35565e63f9461f81b17f432764b5ca25e02856c.zip
FreeBSD-src-f35565e63f9461f81b17f432764b5ca25e02856c.tar.gz
supported IPV6_RECVPATHMTU socket option.
Obtained from: KAME
Diffstat (limited to 'sys/netinet6/in6_pcb.c')
-rw-r--r--sys/netinet6/in6_pcb.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
index a19a1eb..1c7278c 100644
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -610,12 +610,13 @@ in6_mapped_peeraddr(struct socket *so, struct sockaddr **nam)
* Must be called at splnet.
*/
void
-in6_pcbnotify(head, dst, fport_arg, src, lport_arg, cmd, notify)
+in6_pcbnotify(head, dst, fport_arg, src, lport_arg, cmd, cmdarg, notify)
struct inpcbhead *head;
struct sockaddr *dst;
const struct sockaddr *src;
u_int fport_arg, lport_arg;
int cmd;
+ void *cmdarg;
struct inpcb *(*notify) __P((struct inpcb *, int));
{
struct inpcb *inp, *ninp;
@@ -662,6 +663,22 @@ in6_pcbnotify(head, dst, fport_arg, src, lport_arg, cmd, notify)
continue;
/*
+ * If the error designates a new path MTU for a destination
+ * and the application (associated with this socket) wanted to
+ * know the value, notify. Note that we notify for all
+ * disconnected sockets if the corresponding application
+ * wanted. This is because some UDP applications keep sending
+ * sockets disconnected.
+ * XXX: should we avoid to notify the value to TCP sockets?
+ */
+ if (cmd == PRC_MSGSIZE && (inp->inp_flags & IN6P_MTU) != 0 &&
+ (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr) ||
+ IN6_ARE_ADDR_EQUAL(&inp->in6p_faddr, &sa6_dst->sin6_addr))) {
+ ip6_notify_pmtu(inp, (struct sockaddr_in6 *)dst,
+ (u_int32_t *)cmdarg);
+ }
+
+ /*
* Detect if we should notify the error. If no source and
* destination ports are specifed, but non-zero flowinfo and
* local address match, notify the error. This is the case
OpenPOWER on IntegriCloud