> On March 30, 2014, 6:07 p.m., Cong Wang wrote: > > src/linux/routing.cpp, line 271 > > <https://reviews.apache.org/r/19702/diff/4/?file=540352#file540352line271> > > > > We already moved to the new API to create a veth pair: > > rtnl_link_veth_add(). > > Jie Yu wrote: > I have two reasons not using rtnl_link_veth_add() here: > > 1) rtnl_link_veth_add() requires a 'pid' argument. For testing purpose, I > need a version that does not require 'pid' to be passed in. > > 2) I need a way to call rtnl_link_add with flag: NLM_F_CREATE | > NLM_F_EXCL so that we only create the veth pair if it does not exist and we > need a way to detect that (i.e., returning -NLE_EXIST if exists).
1) Just pass getpid(), that is the current netns. It is designed for this. 2) I think I should change the flags to rtnl_link_veth_add(), NLM_F_CREATE|NLM_F_EXCL makes sense for it. So, just use it. - Cong ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/19702/#review39009 ----------------------------------------------------------- On March 29, 2014, 5:59 a.m., Jie Yu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/19702/ > ----------------------------------------------------------- > > (Updated March 29, 2014, 5:59 a.m.) > > > Review request for mesos, Benjamin Hindman, Chi Zhang, Ian Downes, Vinod > Kone, and Cong Wang. > > > Repository: mesos-git > > > Description > ------- > > UPDATE: > > 1) adjusted a few interfaces per review comments. > 2) added impl. (including tests) for managing links. > > I'll be adding impl. for managing filters soon (currently, they return > Error("Unimplemented").) > > > ------ > > Hey guys, I send this review in order to get an idea about the interface > design. > > Feel free to jump in to express your thoughts, suggestions, concerns, etc. > > Thanks! > > > Diffs > ----- > > configure.ac 5404dc2 > src/Makefile.am 47d03b3 > src/linux/routing.hpp PRE-CREATION > src/linux/routing.cpp PRE-CREATION > src/tests/routing_tests.cpp PRE-CREATION > > Diff: https://reviews.apache.org/r/19702/diff/ > > > Testing > ------- > > make check > > sudo make check > > > Thanks, > > Jie Yu > >
