move IPPROTO_TLS to netdev to avoid src/syscall dependency

This commit is contained in:
Scott Feldman
2023-03-28 11:19:17 -07:00
committed by deadprogram
parent 693edae782
commit 331151cafe
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -4,6 +4,12 @@ import (
"time"
)
const (
// Made up, not a real IP protocol number. This is used to create a
// TLS socket on the device, assuming the device supports mbed TLS.
IPPROTO_TLS = 0xFE
)
// netdev is the current netdev, set by the application with useNetdev()
var netdev netdever
+1 -1
View File
@@ -31,7 +31,7 @@ func DialTLS(addr string) (*TLSConn, error) {
port = 443
}
fd, err := netdev.Socket(syscall.AF_INET, syscall.SOCK_STREAM, syscall.IPPROTO_TLS)
fd, err := netdev.Socket(syscall.AF_INET, syscall.SOCK_STREAM, IPPROTO_TLS)
if err != nil {
return nil, err
}