moby / moby/libnetwork

can't set gateway with ipv6 address with all one host bit

Open
#2,478 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.2k
Forks
875
PR merge metrics
No merged PRs in 30d

Description

# docker network create -d macvlan \
    --ipv6 \
    --subnet=fd6d:1111:2222::/64 \
    --gateway=fd6d:1111:2222::ffff:ffff:ffff:ffff \
    -o parent=eth1.2 \
    macvlan.2

Error response from daemon: failed to allocate gateway (fd6d:1111:2222::ffff:ffff:ffff:ffff): bit does not belong to the sequence

This error is generated by https://github.com/docker/libnetwork/blob/master/bitseq/sequence.go#L389 called by https://github.com/docker/libnetwork/blob/master/ipam/allocator.go#L586 .

IPv6 address with all host bits set to one is valid address, while in case of ipv4, address with all host bits set to one is broadcast address.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Docker network create command, then read bitseq/sequence.go around line 389 and ipam/allocator.go around line 586. Confirm the expected handling of an IPv6 gateway with all host bits set to one, while preserving the existing IPv4 behavior; done means the reported command no longer returns the sequence error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.