Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NETLINK_ROUTE support #578

Open
ianlewis opened this issue Jul 22, 2019 · 9 comments
Open

NETLINK_ROUTE support #578

ianlewis opened this issue Jul 22, 2019 · 9 comments

Comments

@ianlewis
Copy link
Contributor

@ianlewis ianlewis commented Jul 22, 2019

Much of netlink socket route support is not implemented. Need to figure out the full scope of work needed to fully support.
See: http://man7.org/linux/man-pages/man7/rtnetlink.7.html

Rough list of scope:

  • ip route list
  • ip route get
  • ip route add
  • ip route del
  • ip addr list
  • ip addr add
  • ip addr del
  • ip link list
  • ip link add
  • ip link delete
  • ip link set eth0 up/down
@prattmic
Copy link
Member

@prattmic prattmic commented Jul 22, 2019

The existing support is sufficient for glibc getifaddrs(3) and basic ip route/addr and ifconfig support.

@ianlewis
Copy link
Contributor Author

@ianlewis ianlewis commented Jul 23, 2019

ip route is a WIP and will get merged shortly. #508

ip addr and ifconfig work right now. ip addr, ifconfig, ip route (after merge) are support read-only actions i.e. 'ip addr [list]', 'ip route [list]' etc. 'ip route add' and other actions to update interface, address, and route info are currently not supported.

@ghanan94
Copy link
Member

@ghanan94 ghanan94 commented Jun 3, 2020

@liornm
Copy link
Contributor

@liornm liornm commented May 19, 2021

It seems like "ip route add" (RTM_NEWROUTE) is not yet supported (despite the check mark).

else if hdr.Flags&linux.NLM_F_REQUEST == linux.NLM_F_REQUEST {
		switch hdr.Type {
		case linux.RTM_GETLINK:
			return p.getLink(ctx, msg, ms)
		case linux.RTM_GETROUTE:
			return p.dumpRoutes(ctx, msg, ms)
		case linux.RTM_NEWADDR:
			return p.newAddr(ctx, msg, ms)
		case linux.RTM_DELADDR:
			return p.delAddr(ctx, msg, ms)
		default:
			return syserr.ErrNotSupported
		}
	}

Am I missing something?

@ianlewis
Copy link
Contributor Author

@ianlewis ianlewis commented May 20, 2021

@liornm Yes. I'm not sure why that was checked. I updated the checklist.

@liornm
Copy link
Contributor

@liornm liornm commented May 20, 2021

@ianlewis Does anyone currently working on it?
I will be happy to contribute this.

@ianlewis
Copy link
Contributor Author

@ianlewis ianlewis commented May 20, 2021

@liornm No one is currently working on it. Feel free to submit a PR for the parts you need.

@liornm
Copy link
Contributor

@liornm liornm commented May 20, 2021

Does the stack.RouteTable() ever being used for network routing purposes? Because I don't see any references except for the NETLINK_ROUTE.
Otherwise, where is the implementation of the actual routing table?

@ianlewis
Copy link
Contributor Author

@ianlewis ianlewis commented May 21, 2021

RouteTable is only used for returning the route table to the user via netlink right now. If you're looking at adding RTM_NEWROUTE support, you'd likely need to add a new method to the inet.Stack interface and then implement where necessary. I think that's just netstack and hostinet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants