1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/libnetwork/drivers/bridge
Chris Telfer 06922d2d81 Use fmt precision to limit string length
The previous code used string slices to limit the length of certain
fields like endpoint or sandbox IDs.  This assumes that these strings
are at least as long as the slice length.  Unfortunately, some sandbox
IDs can be smaller than 7 characters.   This fix addresses this issue
by systematically converting format string calls that were taking
fixed-slice arguments to use a precision specifier in the string format
itself.  From the golang fmt package documentation:

    For strings, byte slices and byte arrays, however, precision limits
    the length of the input to be formatted (not the size of the output),
    truncating if necessary. Normally it is measured in runes, but for
    these types when formatted with the %x or %X format it is measured
    in bytes.

This nicely fits the desired behavior: it will limit the number of
runes considered for string interpolation to the precision value.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
2018-07-05 17:44:04 -04:00
..
brmanager Adding manager pkg for swarm visible network drivers 2017-05-12 17:16:54 -07:00
bridge.go Use fmt precision to limit string length 2018-07-05 17:44:04 -04:00
bridge_store.go Use fmt precision to limit string length 2018-07-05 17:44:04 -04:00
bridge_test.go Improve scalabiltiy of bridge network isolation rules 2018-03-19 15:48:49 +09:00
errors.go Fix sanbox typo 2016-06-24 15:14:01 -07:00
interface.go Update logrus to v1.0.1 2017-08-07 11:20:47 -07:00
interface_test.go Fix issue for --fixed-cidr when bridge has multiple addresses 2016-10-21 13:58:16 -07:00
labels.go Miscellaneous fixes 2016-03-08 15:49:47 -08:00
link.go Update logrus to v1.0.1 2017-08-07 11:20:47 -07:00
link_test.go Use gofmt with -s instead of goimports 2016-02-12 14:07:00 +01:00
netlink_deprecated_linux.go Reorganize MAC generation functions 2015-07-30 11:06:16 -07:00
netlink_deprecated_linux_armppc64.go Adding ppc64le build tag to compile on IBM Power 2015-08-27 04:18:34 +00:00
netlink_deprecated_linux_notarm.go Revert "add s390x arch build info at the netlink_deprecated_linux bridge driver" 2016-09-09 18:04:45 +02:00
netlink_deprecated_unsupported.go Remove dependency on libcontainer 2015-07-16 13:26:26 -07:00
network_test.go Remove unnecessary string formats 2016-11-22 09:29:53 +08:00
port_mapping.go Support SCTP port mapping 2018-02-13 16:01:03 +09:00
port_mapping_test.go Support SCTP port mapping 2018-02-13 16:01:03 +09:00
setup.go Support network options in rest api 2015-05-23 20:12:29 -07:00
setup_bridgenetfiltering.go Update logrus to v1.0.1 2017-08-07 11:20:47 -07:00
setup_bridgenetfiltering_test.go Refactor of docker PR #11405 2015-07-08 10:15:08 -04:00
setup_device.go Update logrus to v1.0.1 2017-08-07 11:20:47 -07:00
setup_device_test.go Remove unnecessary string formats 2016-11-22 09:29:53 +08:00
setup_firewalld.go Fix concurrent CreateNetwork in bridge driver 2017-09-08 15:18:33 -07:00
setup_ip_forwarding.go Update logrus to v1.0.1 2017-08-07 11:20:47 -07:00
setup_ip_forwarding_test.go Remove unnecessary string formats 2016-11-22 09:29:53 +08:00
setup_ip_tables.go bridge: fix handling errors during setupIPChains() 2018-03-22 17:31:30 +09:00
setup_ip_tables_test.go Improve scalabiltiy of bridge network isolation rules 2018-03-19 15:48:49 +09:00
setup_ipv4.go typo: fix misspells in code and comments 2018-05-29 17:08:41 +08:00
setup_ipv4_test.go Migrate libnetwork to use netlink.Handle 2016-06-08 21:05:36 -07:00
setup_ipv6.go Update logrus to v1.0.1 2017-08-07 11:20:47 -07:00
setup_ipv6_test.go Migrate libnetwork to use netlink.Handle 2016-06-08 21:05:36 -07:00
setup_verify.go Update logrus to v1.0.1 2017-08-07 11:20:47 -07:00
setup_verify_test.go Migrate libnetwork to use netlink.Handle 2016-06-08 21:05:36 -07:00