mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix nameserver regex.
This commit is contained in:
parent
d589cc3622
commit
1e5ba57de3
1 changed files with 1 additions and 1 deletions
|
@ -944,7 +944,7 @@ func StripComments(input []byte, commentMarker []byte) []byte {
|
||||||
func GetNameserversAsCIDR(resolvConf []byte) []string {
|
func GetNameserversAsCIDR(resolvConf []byte) []string {
|
||||||
var parsedResolvConf = StripComments(resolvConf, []byte("#"))
|
var parsedResolvConf = StripComments(resolvConf, []byte("#"))
|
||||||
nameservers := []string{}
|
nameservers := []string{}
|
||||||
re := regexp.MustCompile(`^\s*nameserver\s*(([0-9]\.){3}([0-9]))\s*$`)
|
re := regexp.MustCompile(`^\s*nameserver\s*(([0-9]+\.){3}([0-9]+))\s*$`)
|
||||||
for _, line := range bytes.Split(parsedResolvConf, []byte("\n")) {
|
for _, line := range bytes.Split(parsedResolvConf, []byte("\n")) {
|
||||||
var ns = re.FindSubmatch(line)
|
var ns = re.FindSubmatch(line)
|
||||||
if len(ns) > 0 {
|
if len(ns) > 0 {
|
||||||
|
|
Loading…
Reference in a new issue