Menu

#375 Add support for IPv6 LAN Configuration Parameters

version-1.8.18
closed-fixed
None
5
2016-08-21
2015-03-19
No

This patch adds support for IPMI v2.0 IPv6-related LAN configuration parameters.

1 Attachments

Discussion

1 2 > >> (Page 1 of 2)
  • Zdenek Styblik

    Zdenek Styblik - 2015-07-25

    I did give this very quick look and I didn't like what I saw. Sorry. :-( I'll try again ... later.

     
  • Dmitry Bazhenov

    Dmitry Bazhenov - 2015-07-28

    I found an error in printing DHCP DUID. Here's an updated patch. Looking forward for comments.

     

    Last edit: Dmitry Bazhenov 2015-07-28
  • Zdenek Styblik

    Zdenek Styblik - 2015-11-04
    • Group: version-1.8.16 --> version-cvs
     
  • Dmitry Bazhenov

    Dmitry Bazhenov - 2015-11-04

    Hi Zdenek,

    This is the most recent, debugged patch for LAN IP6 configuration parameters.
    I can't understand why this ticket takes so long to be accepted. It does not break any unrelated functionality and brings new and useful stuff which many would like to have.

    Reagrds, Dmitry

     
    • Zdenek Styblik

      Zdenek Styblik - 2015-11-04

      Hello Dmitry,

      This is the most recent, debugged patch for LAN IP6 configuration parameters.

      yet even one year later it still has windows new-lines. Skimming quickly through the patch, I remain unsold on wrapping help text, or text of any kind, with structure. Please, sell it to me as to fellow programmer.

      I can't understand why this ticket takes so long to be accepted. It does not break any unrelated functionality and brings new and useful stuff which many would like to have.

      Please, help me out here and tell me where to begin to answer your question. It's not like you're new to this project, are you?
      I admit there weren't that many commits between now and then, but is it possible other people do something differently to get their stuff in? Just a thought.

      Regards,
      Z.

       
      • Dmitry Bazhenov

        Dmitry Bazhenov - 2015-11-04

        Zdenek,

        I fixed new line endings, my bad.

        For the rest, it was my design decision to make parsing of the command line more structured.
        I still believe that this decision is better than one used in ipmi_lanp.c, for example.
        It seems like it is a matter of taste. I can't waste more time redoing a big piece of code without any reasonable argument. If someone would suggest a better decision and volounteers to rewrite the code or suggests an alternative patch, I won't resist since the main purpose of this patch is to add the needed functionality. The patch adds it, compiles without errors, and works, which is the main idea of the tool.

        Regards,
        Dmitry

         
  • Dmitry Bazhenov

    Dmitry Bazhenov - 2015-11-05

    Added ticket ID and description.

     
  • Dmitry Bazhenov

    Dmitry Bazhenov - 2016-04-22

    Made a complete rework of the patch.
    Implemented a confguration parameter framework which leverages parameter handling and introduces such abilities as saving and loading parameters to/from files (which I find very convenient feature to have). For this purpose has reworked command line parsing (and moved the implementation from src/ipmishell.c to lib/helper.c).

     
  • Dmitry Bazhenov

    Dmitry Bazhenov - 2016-05-04

    Hello, Zdenek,

    Now that the release is done, please, consider reviewing the updated patch.

    Regards,
    Dmitry

     
  • Dmitry Bazhenov

    Dmitry Bazhenov - 2016-05-17

    Latest commits caused a merge conflict. Updated the patch to resolve the conflict.

     
  • Zdenek Styblik

    Zdenek Styblik - 2016-05-28

    I did read through the patch, but I don't know what to say.

     
  • Zdenek Styblik

    Zdenek Styblik - 2016-05-29

    Let me put it this way. Anyone who's willing to put time and effort to get this in, feel free to ping me. I'm happy to discuss.

     
    • Dmitry Rakhchev

      Dmitry Rakhchev - 2016-06-28

      I have some time to invest into this, however I do not want to waste it, so let's discuss what need to be done first.

      I've browsed existing patch and propose the following reworks:

      1. Do not touch ipmishell parsing code. It looks possible to get rid of "struct cmdargs", "cmdexp" and "cmdfree".
      2. On the other hand the ability to save and load settings looks appeal. I propose the following approach: use "save" command that will write script, that can be piped to ipmishell later for "loading".

      What do you think about the possibility to give control over lock/discard/commit to the user? I think normal "set" shall do automatic locking by default, but if a special arg ("nocommit") is given, leave it to the user. This can be useful when you need to update lan settings over lan to prevent loosing the connection to the board after first parameter(s) is updated and comitted.

      This way, I expect the following subcommands to the "lan6":

      help -- print usage
      print -- print parameters
      set [nocommit] [<set_sel> [<block_sel>]] <param> <value>-- set parameter
      lock,
      commit,
      discard-- control "Set In Progress"
      save -- write a script for ipmishell to set parameters to currently effective values

      I appreciate if you can provide some hints on the code style you expect. Normally I try to mimic the style used in the file I'm hacking, but it looks like you are disappointed with the style of original author.

      Any other suggestions are welcome as well.

       
      • Zdenek Styblik

        Zdenek Styblik - 2016-06-28

        Hi,

        I will have to re-read the patch itself, but off-the-bat:

        • licence header is missing. Despite BSD is assumed, it should be present in each and every file.
        • I strongly disagree with the introduction of str2uchar_hex() and alike. str2uchar() and friends for sure have short-coming of hard-coded base=10. To be true, I know about this limitation for some time. However, I don't think, I disagree, with fix of form "Let's add more functions!". str2* functions should be extended. Unfortunately, this means more work. This MUST be provided as a separate patch.
        • mac2str() is introduced. MAC address is being parsed somewhere in the code already. I believe it's in lib/ipmi_lanp.c. So, I don't understand why code isn't being reused. And it's even possible that mac2str() is superior to whatever is already in codebase. In that case, I expect it, and functions alike, to be placed in lib/helper.c(I don't know of better place) and calls being made to such functions from various modules, old code removed. Yes, it means even more work, but less clutter and duplication. This too MUST be provided as a separate patch.
        • buf2str() prototype has been changed, but not the function itself? Such change should go in separate patch as well.
        • buf2str2() is missing documentation. Also, I'm not sure 2 is really good distinction ... but ok. However, wouldn't it make sense to simply extendbuf2str() instead? Say, if (sep > 0) { rather than introducing new function. Up for discussion/consideration, but doesn't it make sense? On the other hand, it would mean bigger memory footprint.
        • Size of those static buffers in buf2str() and buf2str2() should be set through #define, so the size is known outside of those functions. Nice to have.

        Actually, let's do these first and then we can talk more. I don't want to read into (this gigantic) patch again right now and then later on, again, because I did couple times before.

        About the cmdexp, quick look guess is, it moves original code elsewhere and hopefully makes the whole thing cleaner. I will have to give it some look and read.

        I appreciate if you can provide some hints on the code style you expect.

        Expected code style is described at https://sourceforge.net/p/ipmitool/wiki/Coding%20Standards/ . It's not perfect, that's for sure. What is written there, however, applies to the rest of the code that haven't been discussed. Also, it's the reason why I don't want to review it now.

        Normally I try to mimic the style used in the file I'm hacking, but it looks like you are disappointed with the style of original author.

        That's commendable and that's how it should be. However, it's not possible with IPMI tool since each and every part has different style.

        Z.

         
        • Dmitry Rakhchev

          Dmitry Rakhchev - 2016-06-28

          Good, I'll try to produce mentioned separate patches first, they make sense even without ipv6.

           
  • Zdenek Styblik

    Zdenek Styblik - 2016-06-29

    Cool. btw please, don't worry about code formatting in lanp6 module right now. In my opinion, it would be waste of time right now and you'd be p***ed off in the end if there are any changes required. Just replace what's being changed(as outlined above) and we will get to formatting later.
    I hope you haven't done already! :\

    Thanks,
    Z.

     
  • Zdenek Styblik

    Zdenek Styblik - 2016-07-31

    I've merged patches 1-6. Thanks! I believe there was goto out; missing when ipmi_parse_hex() returns (-1). Please, see attached patch.
    Anyway, IPv6 patch is next then.

    For 06:unsigned int vs uint8_t: sscanf argument corresponding to "%02x" shall be pointer to unsigned int. Passing anything else(even uint32_t *) is looking for trouble.

    You're right. Later on, I've realized why those checks are there. It's because ssanf() to unsigned int which is, few lines later, being casted to uint8_t. And we're making sure there is no overflow. :)
    It's good not to listen to and accept everything I say. :)

    I will be on a vacation without access to computer until mid-August, so do not expect quick response.

    Have a nice vacation. I'm quite dead in the water at the moment anyway :(

    Z.

     
  • Zdenek Styblik

    Zdenek Styblik - 2016-08-07

    Ok, I've read through and here's the list:

      • CFGP_SAVE, / output parameter data in form that + can be parsed back / ~ this comment style seems to be "broken".
    • IPMI_CFGP ~ macros shouldn't be used, if possible.
    • struct ipmi_cfgp { ~ is using bitfields which are GCC specific
    • ctx->v = d->next; free(d); ~ missing d = NULL; and I would say this is a common for all occurrences of free()
    • return ret ? -1 : 0; ~ please, can this be changed to if() block?

    Other than that, I guess it's fine.

    Thanks,
    Z.

     
  • Zdenek Styblik

    Zdenek Styblik - 2016-08-07
    • Group: version-cvs --> version-1.8.18
     
  • Dmitry Rakhchev

    Dmitry Rakhchev - 2016-08-15

    CFGP_SAVE, / output parameter data in form that + can be parsed back / ~ this comment style seems to be "broken".
    IPMI_CFGP ~ macros shouldn't be used, if possible.
    ctx->v = d->next; free(d); ~ missing d = NULL; and I would say this is a common for all occurrences of free()
    return ret ? -1 : 0; ~ please, can this be changed to if() block?
    Fixed.

    struct ipmi_cfgp { ~ is using bitfields which are GCC specific
    Excerpt from pre-C89 draft:

    A bit-field may have type int , unsigned int , or signed int .
    Whether the high-order bit position of a ``plain'' int bit-field is
    treated as a sign bit is implementation-defined.  A bit-field is
    interpreted as an integral type consisting of the specified number of
    bits.
    

    I assume using unsigned int as bit-field type is strictly conformant.
    Another free source that confirms this is C90 Rationale document:

    Three types of bit-fields are now defined: plain int calls for implementation-defined signedness (as in K&R), signed int calls for assuredly signed fields, and unsigned int calls for unsigned fields. The old constraints on bit-fields crossing word boundaries have been
    relaxed, since so many properties of bit-fields are implementation dependent anyway.
    

    Its using other integer types(not [unsigned | signed] int) as type for bit-field is a gcc extension. It is quite handy in describing IPMI structures, but non-portable.

    If you insist I may replace bit-field with unsigned char.

     
    • Zdenek Styblik

      Zdenek Styblik - 2016-08-21

      I see. I didn't know bitfields are part of spec. But then, I don't really go for bitfields ... ever :) Cool!

      It is quite handy in describing IPMI structures, but non-portable.

      Indeed. Although, portability can be achieved at the cost of either helper functions or higher memory consumption. Bitfields aren't completely for free either, although probably really cheap(guessing).

      If you insist I may replace bit-field with unsigned char.

      Hm? Sorry, but I don't follow. struct in question is conformant, resp. is using unsigned int, doesn't it? Also, I don't insist on that many things. ;)

      Z.

       
1 2 > >> (Page 1 of 2)

Log in to post a comment.