Commit Graph

12 Commits

Author SHA1 Message Date
Vishvananda Ishaya
b8d3e51d2a actually ignore routes from other interfaces 2015-08-17 17:37:46 -07:00
Vishvananda Ishaya
27f66da7b4 allow RouteDel to work on kernel routes 2015-07-27 09:32:07 -07:00
Alexander Morozov
12f4097df1 Fix some style issues as suggested by golint
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-18 17:41:46 -07:00
Arnaud Porterie
8eb6423887 Fix panic when adding an incomplete route
RouteAdd expects at least Dst.IP, Src, or Gw to be set, but accesses the
destination IP without testing for Dst being nil in the first place.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-24 11:13:56 -08:00
Dave Tucker
80a80badbd Implement basic route get functionality
This provides the basic functionality of the iproute2 `route get`
command. It allows you to query netlink for the route to a destination
IP.Net

While implementing I noticed that the `s.Receive()` function was hanging
after the netlink response was recieved, so I added an additional clause
to break from the loop and return the decoded message if the NLM_F_MULTI
flag is not set.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2015-01-11 18:15:59 +00:00
Eugene Yakubovich
e7911d879f Use LinkIndex instead of Link obj in Route, Neigh
Having object composition causes both client and library to
do potentially unecessary work to retrieve Link attributes
when only index is often sufficient.
2014-10-13 16:09:09 -07:00
Vishvananda Ishaya
f87c54f846 Make links have different types 2014-09-24 16:32:16 -07:00
Vishvananda Ishaya
1a26b9f251 Move all low level calls into nl subpackage 2014-09-18 19:04:48 -07:00
Vishvananda Ishaya
c84dba1b12 Convert syscall.AF_INET to FAMILY_V4 2014-09-17 09:33:53 -07:00
Vishvananda Ishaya
950b852cad Add scope parameter to route 2014-09-14 17:44:56 -07:00
Vishvananda Ishaya
9f98335fb3 Change route to hold pointers to structs 2014-09-07 11:27:46 -07:00
Vishvananda Ishaya
8dab8b7462 Initial commit of netlink package 2014-08-31 20:34:46 -07:00