Commit abe8fd0f authored by Mikio Hara's avatar Mikio Hara

go.net/ipv6: simplfy control message marshaling

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/45640043
parent 213540a1
......@@ -143,9 +143,7 @@ func marshalControlMessage(cm *ControlMessage) (oob []byte) {
m.Type = sysSockopt2292NextHop
m.SetLen(syscall.CmsgLen(syscall.SizeofSockaddrInet6))
sa := (*syscall.RawSockaddrInet6)(unsafe.Pointer(&oob[off+syscall.CmsgLen(0)]))
sa.Len = syscall.SizeofSockaddrInet6
sa.Family = syscall.AF_INET6
copy(sa.Addr[:], cm.NextHop)
setSockaddr(sa, cm.NextHop, cm.IfIndex)
off += syscall.CmsgSpace(syscall.SizeofSockaddrInet6)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment