diff options
author | Chris Kuiper <ckuiper@google.com> | 2019-07-24 13:40:52 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-07-24 13:42:14 -0700 |
commit | 40e682759fd68bf94d324cef584c5e9288acb049 (patch) | |
tree | 08a4bc36c10aecaf4edde00f03e315e7a3d3c533 /pkg/sentry/socket | |
parent | 7e38d643334647fb79c7cc8be35745699de264e6 (diff) |
Add support for a subnet prefix length on interface network addresses
This allows the user code to add a network address with a subnet prefix length.
The prefix length value is stored in the network endpoint and provided back to
the user in the ProtocolAddress type.
PiperOrigin-RevId: 259807693
Diffstat (limited to 'pkg/sentry/socket')
-rw-r--r-- | pkg/sentry/socket/epsocket/stack.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/sentry/socket/epsocket/stack.go b/pkg/sentry/socket/epsocket/stack.go index 7eef19f74..8fe489c0e 100644 --- a/pkg/sentry/socket/epsocket/stack.go +++ b/pkg/sentry/socket/epsocket/stack.go @@ -75,8 +75,8 @@ func (s *Stack) InterfaceAddrs() map[int32][]inet.InterfaceAddr { addrs = append(addrs, inet.InterfaceAddr{ Family: family, - PrefixLen: uint8(len(a.Address) * 8), - Addr: []byte(a.Address), + PrefixLen: uint8(a.AddressWithPrefix.PrefixLen), + Addr: []byte(a.AddressWithPrefix.Address), // TODO(b/68878065): Other fields. }) } |