On Tue, Feb 20, 2018 at 5:08 AM, Stefan Sperling <s...@stsp.name> wrote: > On Mon, Feb 19, 2018 at 05:09:58PM -0800, Ayaka Koshibe wrote: >> Index: sbin/ifconfig/ifconfig.c >> =================================================================== >> RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v >> retrieving revision 1.353 >> diff -u -p -u -p -r1.353 ifconfig.c >> --- sbin/ifconfig/ifconfig.c 16 Jan 2018 10:33:55 -0000 1.353 >> +++ sbin/ifconfig/ifconfig.c 20 Feb 2018 00:02:48 -0000 >> @@ -220,6 +220,7 @@ void unsetvlandev(const char *, int); >> void mpe_status(void); >> void mpw_status(void); >> void setrdomain(const char *, int); >> +void unsetrdomain(const char *, int); >> int prefix(void *val, int); >> void getifgroups(void); >> void setifgroup(const char *, int); >> @@ -397,6 +398,7 @@ const struct cmd { >> { "rtlabel", NEXTARG, 0, setifrtlabel }, >> { "-rtlabel", -1, 0, setifrtlabel }, >> { "rdomain", NEXTARG, 0, setrdomain }, >> + { "-rdomain", 0, 0, unsetrdomain }, > > I don't have an opinion about whether -rdomain is a necessary > addition or not. I could live fine with either. > > But that question aside: > > I doubt the new function 'unsetrdomain' is really needed. > It seems that instead of adding unsetrdomain() we could make > the -rdomain option invoke setrdomain() with rdomain id 0. > > I haven't tested this idea, though. > Does your change work without the new function unsetrdomain? > I.e. a diff which only adds this to ifconfig.c: > > + { "-rdomain", 0, 0, setrdomain },
I added the new function because I saw that setrdomain() is passing the id to strtonum() first thing, and I thought I'd need to modify setrdomain() otherwise.