"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "components/engine/vendor/github.com/docker/libnetwork/ns/init_linux.go" between
docker-ce-19.03.2.tar.gz and docker-ce-19.03.3.tar.gz

About: Docker CE is a project to pack, ship and run any application as a lightweight container. Docker containers can run anywhere, on a laptop or at scale, in production, on VMs, bare metal, OpenStack clusters, public clouds and more. Community edition.

init_linux.go  (docker-ce-19.03.2):init_linux.go  (docker-ce-19.03.3)
skipping to change at line 79 skipping to change at line 79
// NlHandle returns the netlink handler // NlHandle returns the netlink handler
func NlHandle() *netlink.Handle { func NlHandle() *netlink.Handle {
initOnce.Do(Init) initOnce.Do(Init)
return initNl return initNl
} }
func getSupportedNlFamilies() []int { func getSupportedNlFamilies() []int {
fams := []int{syscall.NETLINK_ROUTE} fams := []int{syscall.NETLINK_ROUTE}
// NETLINK_XFRM test // NETLINK_XFRM test
if err := loadXfrmModules(); err != nil { if err := checkXfrmSocket(); err != nil {
if checkXfrmSocket() != nil { logrus.Warnf("Could not load necessary modules for IPSEC rules: %
logrus.Warnf("Could not load necessary modules for IPSEC v", err)
rules: %v", err)
} else {
fams = append(fams, syscall.NETLINK_XFRM)
}
} else { } else {
fams = append(fams, syscall.NETLINK_XFRM) fams = append(fams, syscall.NETLINK_XFRM)
} }
// NETLINK_NETFILTER test // NETLINK_NETFILTER test
if err := loadNfConntrackModules(); err != nil { if err := loadNfConntrackModules(); err != nil {
if checkNfSocket() != nil { if checkNfSocket() != nil {
logrus.Warnf("Could not load necessary modules for Conntr ack: %v", err) logrus.Warnf("Could not load necessary modules for Conntr ack: %v", err)
} else { } else {
fams = append(fams, syscall.NETLINK_NETFILTER) fams = append(fams, syscall.NETLINK_NETFILTER)
} }
} else { } else {
fams = append(fams, syscall.NETLINK_NETFILTER) fams = append(fams, syscall.NETLINK_NETFILTER)
} }
return fams return fams
} }
func loadXfrmModules() error {
if out, err := exec.Command("modprobe", "-va", "xfrm_user").CombinedOutpu
t(); err != nil {
return fmt.Errorf("Running modprobe xfrm_user failed with message
: `%s`, error: %v", strings.TrimSpace(string(out)), err)
}
if out, err := exec.Command("modprobe", "-va", "xfrm_algo").CombinedOutpu
t(); err != nil {
return fmt.Errorf("Running modprobe xfrm_algo failed with message
: `%s`, error: %v", strings.TrimSpace(string(out)), err)
}
return nil
}
// API check on required xfrm modules (xfrm_user, xfrm_algo) // API check on required xfrm modules (xfrm_user, xfrm_algo)
func checkXfrmSocket() error { func checkXfrmSocket() error {
fd, err := syscall.Socket(syscall.AF_NETLINK, syscall.SOCK_RAW, syscall.N ETLINK_XFRM) fd, err := syscall.Socket(syscall.AF_NETLINK, syscall.SOCK_RAW, syscall.N ETLINK_XFRM)
if err != nil { if err != nil {
return err return err
} }
syscall.Close(fd) syscall.Close(fd)
return nil return nil
} }
 End of changes. 2 change blocks. 
21 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)