alicelinux

A lightweight musl + clang/llvm + libressl + busybox distro
git clone https://codeberg.org/emmett1/alicelinux
Log | Files | Refs | README | LICENSE

nla_s8.patch (802B)


      1 diff --git a/include/netlink/attr.h b/include/netlink/attr.h
      2 index 3e3047f..789e8c2 100644
      3 --- a/include/netlink/attr.h
      4 +++ b/include/netlink/attr.h
      5 @@ -45,6 +45,7 @@ enum {
      6  	NLA_FLAG,	/**< Flag */
      7  	NLA_MSECS,	/**< Micro seconds (64bit) */
      8  	NLA_NESTED,	/**< Nested attributes */
      9 +	NLA_S8,
     10  	__NLA_TYPE_MAX,
     11  };
     12  
     13 @@ -248,6 +249,17 @@ static inline int nla_put_addr(struct nl_msg *msg, int attrtype, struct nl_addr
     14   * @name Integer Attributes
     15   */
     16  
     17 +/**
     18 + * Return value of 8 bit signed integer attribute.
     19 + * @arg nla             8 bit integer attribute
     20 + *
     21 + * @return Payload as 8 bit integer
     22 + */
     23 +static inline int8_t nla_get_s8(const struct nlattr *nla)
     24 +{
     25 +	return *(const int8_t *) nla_data(nla);
     26 +}
     27 +
     28  /**
     29   * Add 8 bit integer attribute to netlink message.
     30   * @arg msg		Netlink message.