From 24b30d0e6b03584854eb149ab7a8a3127b2e261d Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sun, 15 Oct 2023 20:19:57 +0200 Subject: [PATCH] build: update nixpkgs --- flake.lock | 6 ++--- flake.nix | 2 +- src/daemon/protocols/lldp.c | 45 +++++++++++++++++-------------------- 3 files changed, 25 insertions(+), 28 deletions(-) diff --git a/flake.lock b/flake.lock index 4bde8dca..fef0c7ea 100644 --- a/flake.lock +++ b/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659606041, - "narHash": "sha256-W4/u2ssr3fS4XOtltrsDD9w2kF4jYYZr6JyPGUW2jdI=", + "lastModified": 1697009197, + "narHash": "sha256-viVRhBTFT8fPJTb1N3brQIpFZnttmwo3JVKNuWRVc3s=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5f9b871b72b24f066b1a1e189efd0669f2888c49", + "rev": "01441e14af5e29c9d27ace398e6dd0b293e25a54", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index f4ec5579..9a18cd3b 100644 --- a/flake.nix +++ b/flake.nix @@ -25,7 +25,7 @@ "--with-systemdsystemunitdir=\${out}/lib/systemd/system" ]; - nativeBuildInputs = with pkgs; [ pkgconfig autoreconfHook git check ]; + nativeBuildInputs = with pkgs; [ pkg-config autoreconfHook git check ]; buildInputs = with pkgs; [ libevent readline net-snmp openssl ]; outputs = [ "out" "dev" "man" "doc" ]; }; diff --git a/src/daemon/protocols/lldp.c b/src/daemon/protocols/lldp.c index 03b6b680..647c6e97 100644 --- a/src/daemon/protocols/lldp.c +++ b/src/daemon/protocols/lldp.c @@ -323,14 +323,13 @@ _lldp_send(struct lldpd *global, struct lldpd_hardware *hardware, u_int8_t c_id_ /* LLDP-MED inventory */ # define LLDP_INVENTORY(value, subtype) \ - if (value) { \ - if (!(POKE_START_LLDP_TLV(LLDP_TLV_ORG) && \ - POKE_BYTES(med, sizeof(med)) && POKE_UINT8(subtype) && \ - POKE_BYTES(value, \ - (strlen(value) > 32) ? 32 : strlen(value)) && \ - POKE_END_LLDP_TLV)) \ - goto toobig; \ - } + if (value) { \ + if (!(POKE_START_LLDP_TLV(LLDP_TLV_ORG) && POKE_BYTES(med, sizeof(med)) && \ + POKE_UINT8(subtype) && \ + POKE_BYTES(value, (strlen(value) > 32) ? 32 : strlen(value)) && \ + POKE_END_LLDP_TLV)) \ + goto toobig; \ + } if (port->p_med_cap_enabled & LLDP_MED_CAP_IV) { LLDP_INVENTORY(chassis->c_med_hw, LLDP_TLV_MED_IV_HW); @@ -552,22 +551,20 @@ lldp_send(struct lldpd *global, struct lldpd_hardware *hardware) return 0; } -#define CHECK_TLV_SIZE(x, name) \ - do { \ - if (tlv_size < (x)) { \ - log_warnx("lldp", name " TLV too short received on %s", \ - hardware->h_ifname); \ - goto malformed; \ - } \ - } while (0) -#define CHECK_TLV_MAX_SIZE(x, name) \ - do { \ - if (tlv_size > (x)) { \ - log_warnx("lldp", name " TLV too large received on %s", \ - hardware->h_ifname); \ - goto malformed; \ - } \ - } while (0) +#define CHECK_TLV_SIZE(x, name) \ + do { \ + if (tlv_size < (x)) { \ + log_warnx("lldp", name " TLV too short received on %s", hardware->h_ifname); \ + goto malformed; \ + } \ + } while (0) +#define CHECK_TLV_MAX_SIZE(x, name) \ + do { \ + if (tlv_size > (x)) { \ + log_warnx("lldp", name " TLV too large received on %s", hardware->h_ifname); \ + goto malformed; \ + } \ + } while (0) int lldp_decode(struct lldpd *cfg, char *frame, int s, struct lldpd_hardware *hardware, -- 2.39.5