ONLP backwards compatibility

30 views
Skip to first unread message

D W

unread,
Sep 24, 2020, 5:32:44 PM9/24/20
to opennetworklinux

HI,
  I  built ONL from the commit 264f0f87f9c36884534161c34db2d46a59aaa057 on 7/2/2018. I used that build to create an application that uses ONLP. I was able to run the same binary in systems setup with ONL built from newer commits. But when I tried to run this application on a system with ONL built from the commit 1537d8334d5fc9364f1ce6a44e26eb247e42f2e6 on 8/25/2020 this application stopped working (segmentation fault). The problem (at least one of them) is the change in oids.h (commit b536151a7b2239fee52dbbb2e3ac7912ad64eaf6 4/7/2020)

#define ONLP_OID_TABLE_SIZE 32
was changed to
#define ONLP_OID_TABLE_SIZE 128

and that changed the size of the type onlp_oid_table_t that is part of the struct
onlp_oid_hdr_s   that is part of struct onlp_sys_info_s

typedef struct onlp_oid_hdr_s {
   /** The OID */
   onlp_oid_t id;
   /** The description of this object. */
   onlp_oid_desc_t description;
    /** The parent OID of this object. */
    onlp_oid_t poid;
    /** The children of this OID */ 
     onlp_oid_table_t coids;               <===== size changed 
} onlp_oid_hdr_t;

typedef struct onlp_sys_info_s {
    /** OID Header */
   onlp_oid_hdr_t hdr;                           <===== size changed

   /* ONIE System Information */
   onlp_onie_info_t onie_info;

   /* Platform Information */
   onlp_platform_info_t platform_info;
} onlp_sys_info_t;

In other words, when the old application gets the platform_name member of onie_info member it will use the wrong offset to get the onie_info member of onlp_sys_info_s.

 Was the above change an oversight or is it expected that the ONLP API will change time to time?
  Thanks,

               Diego

Reply all
Reply to author
Forward
0 new messages