فهرست منبع

x/net/ipv6: add missing parentheses

Fixes a crash on platforms that don't support IPV6_PKTINFO.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/167460043
Mikio Hara 11 سال پیش
والد
کامیت
4b6fc9ef6a
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      ipv6/control_unix.go

+ 1 - 1
ipv6/control_unix.go

@@ -137,7 +137,7 @@ func marshalControlMessage(cm *ControlMessage) (oob []byte) {
 		l += syscall.CmsgSpace(ctlOpts[ctlHopLimit].length)
 	}
 	pktinfo := false
-	if ctlOpts[ctlPacketInfo].name > 0 && cm.Src.To16() != nil && cm.Src.To4() == nil || cm.IfIndex > 0 {
+	if ctlOpts[ctlPacketInfo].name > 0 && (cm.Src.To16() != nil && cm.Src.To4() == nil || cm.IfIndex > 0) {
 		pktinfo = true
 		l += syscall.CmsgSpace(ctlOpts[ctlPacketInfo].length)
 	}