diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2017-02-21 12:21:36 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2017-02-21 12:21:36 +0000 |
commit | 167fee23fbf71f65bd79f8dee6ad84a04d618eb5 (patch) | |
tree | e3a071288fb5641446b7c425f60ca5b211406366 | |
parent | 384c07167202f048489a38c1fd2a2f8ac5a082bd (diff) | |
parent | 148434206d3ba623dff65e4b591dffc0ddadebf3 (diff) | |
download | illumos-joyent-167fee23fbf71f65bd79f8dee6ad84a04d618eb5.tar.gz |
[illumos-gate merge]
commit 148434206d3ba623dff65e4b591dffc0ddadebf3
7858 make: do not use auto as type specifier
commit ff524b2355c0ac08bf963297ae8e5ea2e8375852
7857 zfs/zpool commands print scary errors after 7741
7887 get_zfs_dataset() optimised path leaks zfs handle
commit 7199b8e79a66167b9224eed40ed9bd8effcc49a8
7819 IPv6 Packet and MTU bug
commit 2d8dae53e7585d2412a48eceb751cbfaea048241
7883 snoop(1m) should print locktype for NFSv4 LOCKT operation
-rw-r--r-- | usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_nfs4.c | 14 | ||||
-rw-r--r-- | usr/src/cmd/make/lib/bsd/bsd.cc | 6 | ||||
-rw-r--r-- | usr/src/lib/libshare/common/libshare_zfs.c | 14 | ||||
-rw-r--r-- | usr/src/uts/common/inet/ip.h | 4 | ||||
-rw-r--r-- | usr/src/uts/common/inet/ip/ip.c | 12 | ||||
-rw-r--r-- | usr/src/uts/common/inet/ip/ip6.c | 43 | ||||
-rw-r--r-- | usr/src/uts/common/inet/ip/ip6_output.c | 3 |
7 files changed, 47 insertions, 49 deletions
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_nfs4.c b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_nfs4.c index 107020c140..70b95a5562 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_nfs4.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_nfs4.c @@ -686,7 +686,7 @@ static char *acemask4_names[] = { /*ARGSUSED*/ void interpret_nfs4_cb(int flags, int type, int xid, int vers, int proc, - char *data, int len) + char *data, int len) { char *line = NULL; @@ -752,7 +752,7 @@ interpret_nfs4_cb(int flags, int type, int xid, int vers, int proc, /*ARGSUSED*/ void interpret_nfs4(int flags, int type, int xid, int vers, int proc, - char *data, int len) + char *data, int len) { char *line = NULL; @@ -1318,7 +1318,7 @@ sum_lock_denied(LOCK4denied *denied) { static char buf[64]; - sprintf(buf, "%s %llu %llu LO=%04X", + sprintf(buf, "%s %llu:%llu LO=%04X", sum_lock_type_name(denied->locktype), denied->offset, denied->length, owner_hash(&denied->owner.owner)); @@ -1832,7 +1832,8 @@ sumarg_lockt(char *buf, size_t buflen, void *obj) { LOCKT4args *args = (LOCKT4args *)obj; - snprintf(buf, buflen, "R=%llu:%llu", + snprintf(buf, buflen, "%s %llu:%llu", + sum_lock_type_name(args->locktype), args->offset, args->length); } @@ -1852,7 +1853,7 @@ sumarg_locku(char *buf, size_t buflen, void *obj) { LOCKU4args *args = (LOCKU4args *)obj; - snprintf(buf, buflen, "R=%llu:%llu LSQ=%u %s", + snprintf(buf, buflen, "%llu:%llu LSQ=%u %s", args->offset, args->length, args->seqid, sum_lock_stateid(&args->lock_stateid)); } @@ -1938,7 +1939,6 @@ dtlarg_release_lkown(void *obj) static void sumarg_release_lkown(char *buf, size_t buflen, void *obj) - { RELEASE_LOCKOWNER4args *args = (RELEASE_LOCKOWNER4args *)obj; @@ -3675,7 +3675,7 @@ sum_type_name(nfs_ftype4 type) static char * get_flags(uint_t flag, ftype_names_t *names, uint_t num_flags, int shortname, - char *prefix) + char *prefix) { static char buf[200]; char *bp = buf, *str; diff --git a/usr/src/cmd/make/lib/bsd/bsd.cc b/usr/src/cmd/make/lib/bsd/bsd.cc index 931a5286db..23ff9197df 100644 --- a/usr/src/cmd/make/lib/bsd/bsd.cc +++ b/usr/src/cmd/make/lib/bsd/bsd.cc @@ -40,12 +40,12 @@ extern SIG_PF bsd_signal (int Signal, SIG_PF Handler) { - auto SIG_PF previous_handler; + SIG_PF previous_handler; #ifdef sun previous_handler = sigset (Signal, Handler); #else - auto struct sigaction new_action; - auto struct sigaction old_action; + struct sigaction new_action; + struct sigaction old_action; new_action.sa_flags = SA_SIGINFO; new_action.sa_handler = (void (*) ()) Handler; diff --git a/usr/src/lib/libshare/common/libshare_zfs.c b/usr/src/lib/libshare/common/libshare_zfs.c index ec465295b1..08b5a00e9d 100644 --- a/usr/src/lib/libshare/common/libshare_zfs.c +++ b/usr/src/lib/libshare/common/libshare_zfs.c @@ -25,6 +25,7 @@ /* * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright 2017 RackTop Systems. */ #include <stdio.h> @@ -336,11 +337,20 @@ get_zfs_dataset(sa_handle_impl_t impl_handle, char *path, cutpath = path + strspn(path, "/"); assert(impl_handle->zfs_libhandle != NULL); + libzfs_print_on_error(impl_handle->zfs_libhandle, B_FALSE); if ((handle_from_path = zfs_open(impl_handle->zfs_libhandle, cutpath, - ZFS_TYPE_FILESYSTEM)) != NULL) + ZFS_TYPE_FILESYSTEM)) != NULL) { if ((ret = verify_zfs_handle(handle_from_path, path, - search_mnttab)) != NULL) + search_mnttab)) != NULL) { + zfs_close(handle_from_path); + libzfs_print_on_error(impl_handle->zfs_libhandle, + B_TRUE); return (ret); + } + zfs_close(handle_from_path); + } + libzfs_print_on_error(impl_handle->zfs_libhandle, B_TRUE); + /* * Couldn't find a filesystem optimistically, check all the handles we * can. diff --git a/usr/src/uts/common/inet/ip.h b/usr/src/uts/common/inet/ip.h index 748d9f26e7..f8ebb28ce8 100644 --- a/usr/src/uts/common/inet/ip.h +++ b/usr/src/uts/common/inet/ip.h @@ -24,7 +24,7 @@ * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright 2014 Nexenta Systems, Inc. All rights reserved. - * Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved. + * Copyright 2017 OmniTI Computer Consulting, Inc. All rights reserved. */ #ifndef _INET_IP_H @@ -551,7 +551,7 @@ extern void ip_mcast_mapping(struct ill_s *, uchar_t *, uchar_t *); #define DCEF_DEFAULT 0x0001 /* Default DCE - no pmtu or uinfo */ #define DCEF_PMTU 0x0002 /* Different than interface MTU */ #define DCEF_UINFO 0x0004 /* dce_uinfo set */ -#define DCEF_TOO_SMALL_PMTU 0x0008 /* Smaller than IPv4/IPv6 MIN */ +#define DCEF_TOO_SMALL_PMTU 0x0008 /* Smaller than IPv4 MIN */ #ifdef _KERNEL /* diff --git a/usr/src/uts/common/inet/ip/ip.c b/usr/src/uts/common/inet/ip/ip.c index 73081b9c1c..ede8f27cee 100644 --- a/usr/src/uts/common/inet/ip/ip.c +++ b/usr/src/uts/common/inet/ip/ip.c @@ -23,7 +23,7 @@ * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1990 Mentat Inc. * Copyright (c) 2012 Joyent, Inc. All rights reserved. - * Copyright (c) 2014, OmniTI Computer Consulting, Inc. All rights reserved. + * Copyright (c) 2017 OmniTI Computer Consulting, Inc. All rights reserved. */ #include <sys/types.h> @@ -3858,10 +3858,9 @@ ip_get_pmtu(ip_xmit_attr_t *ixa) } /* - * After receiving an ICMPv6 "packet too big" message with a - * MTU < 1280, and for multirouted IPv6 packets, the IP layer - * will insert a 8-byte fragment header in every packet. We compensate - * for those cases by returning a smaller path MTU to the ULP. + * For multirouted IPv6 packets, the IP layer will insert a 8-byte + * fragment header in every packet. We compensate for those cases by + * returning a smaller path MTU to the ULP. * * In the case of CGTP then ip_output will add a fragment header. * Make sure there is room for it by telling a smaller number @@ -3872,8 +3871,7 @@ ip_get_pmtu(ip_xmit_attr_t *ixa) * which is the size of the packets it can send. */ if (!(ixa->ixa_flags & IXAF_IS_IPV4)) { - if ((dce->dce_flags & DCEF_TOO_SMALL_PMTU) || - (ire->ire_flags & RTF_MULTIRT) || + if ((ire->ire_flags & RTF_MULTIRT) || (ixa->ixa_flags & IXAF_MULTIRT_MULTICAST)) { pmtu -= sizeof (ip6_frag_t); ixa->ixa_flags |= IXAF_IPV6_ADD_FRAGHDR; diff --git a/usr/src/uts/common/inet/ip/ip6.c b/usr/src/uts/common/inet/ip/ip6.c index c0b184e9ec..3796690972 100644 --- a/usr/src/uts/common/inet/ip/ip6.c +++ b/usr/src/uts/common/inet/ip/ip6.c @@ -21,6 +21,7 @@ /* * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1990 Mentat Inc. + * Copyright 2017 OmniTI Computer Consulting, Inc. All rights reserved. */ #include <sys/types.h> @@ -682,6 +683,18 @@ icmp_inbound_too_big_v6(icmp6_t *icmp6, ip_recv_attr_t *ira) ip6h = (ip6_t *)&icmp6[1]; final_dst = ip_get_dst_v6(ip6h, NULL, NULL); + mtu = ntohl(icmp6->icmp6_mtu); + if (mtu < IPV6_MIN_MTU) { + /* + * RFC 8021 suggests to ignore messages where mtu is + * less than the IPv6 minimum. + */ + ip1dbg(("Received mtu less than IPv6 " + "min mtu %d: %d\n", IPV6_MIN_MTU, mtu)); + DTRACE_PROBE1(icmp6__too__small__mtu, uint32_t, mtu); + return; + } + /* * For link local destinations matching simply on address is not * sufficient. Same link local addresses for different ILL's is @@ -704,8 +717,6 @@ icmp_inbound_too_big_v6(icmp6_t *icmp6, ip_recv_attr_t *ira) return; } - mtu = ntohl(icmp6->icmp6_mtu); - mutex_enter(&dce->dce_lock); if (dce->dce_flags & DCEF_PMTU) old_max_frag = dce->dce_pmtu; @@ -714,37 +725,15 @@ icmp_inbound_too_big_v6(icmp6_t *icmp6, ip_recv_attr_t *ira) else old_max_frag = ill->ill_mtu; - if (mtu < IPV6_MIN_MTU) { - ip1dbg(("Received mtu less than IPv6 " - "min mtu %d: %d\n", IPV6_MIN_MTU, mtu)); - mtu = IPV6_MIN_MTU; - /* - * If an mtu less than IPv6 min mtu is received, - * we must include a fragment header in - * subsequent packets. - */ - dce->dce_flags |= DCEF_TOO_SMALL_PMTU; - } else { - dce->dce_flags &= ~DCEF_TOO_SMALL_PMTU; - } ip1dbg(("Received mtu from router: %d\n", mtu)); + DTRACE_PROBE1(icmp6__received__mtu, uint32_t, mtu); dce->dce_pmtu = MIN(old_max_frag, mtu); + icmp6->icmp6_mtu = htonl(dce->dce_pmtu); - /* Prepare to send the new max frag size for the ULP. */ - if (dce->dce_flags & DCEF_TOO_SMALL_PMTU) { - /* - * If we need a fragment header in every packet - * (above case or multirouting), make sure the - * ULP takes it into account when computing the - * payload size. - */ - icmp6->icmp6_mtu = htonl(dce->dce_pmtu - sizeof (ip6_frag_t)); - } else { - icmp6->icmp6_mtu = htonl(dce->dce_pmtu); - } /* We now have a PMTU for sure */ dce->dce_flags |= DCEF_PMTU; dce->dce_last_change_time = TICK_TO_SEC(ddi_get_lbolt64()); + mutex_exit(&dce->dce_lock); /* * After dropping the lock the new value is visible to everyone. diff --git a/usr/src/uts/common/inet/ip/ip6_output.c b/usr/src/uts/common/inet/ip/ip6_output.c index 9d28d3f461..b023a2fe6a 100644 --- a/usr/src/uts/common/inet/ip/ip6_output.c +++ b/usr/src/uts/common/inet/ip/ip6_output.c @@ -22,6 +22,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2017 OmniTI Computer Consulting, Inc. All rights reserved. */ /* Copyright (c) 1990 Mentat Inc. */ @@ -245,7 +246,7 @@ repeat_ire: * Older than 20 minutes. Drop the path MTU information. */ mutex_enter(&dce->dce_lock); - dce->dce_flags &= ~(DCEF_PMTU|DCEF_TOO_SMALL_PMTU); + dce->dce_flags &= ~DCEF_PMTU; dce->dce_last_change_time = TICK_TO_SEC(now); mutex_exit(&dce->dce_lock); dce_increment_generation(dce); |