Re: "ifconfig -vlandev" syntax

From: Fredrik Lindberg (fli+freebsd-current_at_shapeshifter.se)
Date: 09/29/05

  • Next message: Gavin Atkinson: "Re: 6.0-BETA2 DRM/witness panic: Assertion j < 1000 failed at /usr/src/sys/kern/subr_witness.c:1513"
    Date: Thu, 29 Sep 2005 18:23:10 +0200
    To: Yar Tikhiy <yar@comp.chem.msu.su>
    
    

    Yar Tikhiy wrote:
    > On Sun, Sep 25, 2005 at 02:37:41PM -0700, Brooks Davis wrote:
    >
    >>On Thu, Sep 22, 2005 at 02:41:05PM +0400, Yar Tikhiy wrote:
    >>
    >>>As our ifconfig(8) is growing more options for special interface
    >>>types, inconsistencies sneak into their syntax. In particular,
    >>>-vlandev takes a useless argument (vlan(4) cannot attach to more
    >>>than one parent anyway) while, e.g., -carpdev doesn't need one.
    >>>Personally, I like the latter since having to type unneeded words
    >>>on the command line annoys me. Do you think that making -vlandev
    >>>need no arguments in CURRENT would break many existing things?
    >>
    >>I agree the argument is useless. Unfortunatly, it's going to be hard to
    >>deprecate the old syntax so we may need to keep it around.
    >
    >
    > Alas, there doesn't seem to exist an easy way to support both
    > syntaxes in the ifconfig(8) parameter parser. Perhaps we can
    > survive the pain of syntax change in CURRENT only, with a
    > heads-up message sent, release notes updated, etc? I wonder
    > if many people use "ifconfig -vlandev XXX" in automated tools.
    >

    Why not use something simple such as the following (maybe even
    without that printf().

    root@genesis> ./ifconfig vlan0 create
    root@genesis> ./ifconfig vlan0 vlan 1 vlandev em0
    root@genesis> ./ifconfig vlan0 -vlandev
    root@genesis> ./ifconfig vlan0 vlan 1 vlandev em0
    root@genesis> ./ifconfig vlan0 -vlandev em0
    Passing interface to -vlandev is deprecated.

    Index: ifvlan.c
    ===================================================================
    RCS file: /home/ncvs/src/sbin/ifconfig/ifvlan.c,v
    retrieving revision 1.7
    diff -u -r1.7 ifvlan.c
    --- ifvlan.c 31 Dec 2004 19:46:27 -0000 1.7
    +++ ifvlan.c 29 Sep 2005 16:19:32 -0000
    @@ -130,6 +130,9 @@
      {
             struct vlanreq vreq;

    + if (val != NULL)
    + fprintf(stderr, "Passing interface to -vlandev is
    deprecated.\n");
    +
             bzero((char *)&vreq, sizeof(struct vlanreq));
             ifr.ifr_data = (caddr_t)&vreq;

    @@ -148,7 +151,7 @@
      static struct cmd vlan_cmds[] = {
             DEF_CMD_ARG("vlan", setvlantag),
             DEF_CMD_ARG("vlandev", setvlandev),
    - DEF_CMD_ARG("-vlandev", unsetvlandev),
    + DEF_CMD_OPTARG("-vlandev",
    unsetvlandev),
             DEF_CMD("vlanmtu", IFCAP_VLAN_MTU, setifcap),
             DEF_CMD("-vlanmtu", -IFCAP_VLAN_MTU, setifcap),
             DEF_CMD("vlanhwtag", IFCAP_VLAN_HWTAGGING, setifcap),

    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"


  • Next message: Gavin Atkinson: "Re: 6.0-BETA2 DRM/witness panic: Assertion j < 1000 failed at /usr/src/sys/kern/subr_witness.c:1513"

    Relevant Pages

    • Re: No more access to characters in strings in PHP 6?
      ... $str[] was deprecated but is now undeprecated ... new syntax, then deprecate the new syntax and re-introduce the old ... Late static binding - no no no, that will make people assume that ...
      (comp.lang.php)
    • Re: TIP #176: Add String Index Values
      ... >>The existing syntax is clumsy, ... It would be better to deprecate ... >>would make a lot of code cleaner. ...
      (comp.lang.tcl)
    • Re: "ifconfig -vlandev" syntax
      ... Yar Tikhiy wrote: ... >>I agree the argument is useless. ... >>deprecate the old syntax so we may need to keep it around. ...
      (freebsd-current)
    • Re: "ifconfig -vlandev" syntax
      ... Yar Tikhiy wrote: ... >>I agree the argument is useless. ... >>deprecate the old syntax so we may need to keep it around. ...
      (freebsd-net)
    • Re: How to make 2 dimensinal aray in Perl $mat(x,y)?
      ... syntax isn't entirely useless. ... I never said it was useless. ... the same as "useless in this context". ... than dropping the arrow, which I disagree with. ...
      (comp.lang.perl.misc)