diff options
| author | Patrick Ruddy <pat@voltanet.io> | 2021-02-15 15:19:48 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-15 15:19:48 +0000 |
| commit | 54c7adbf49e7466e46c91a749fdf0aa31882d937 (patch) | |
| tree | 3fbf88a9d13674d335256d39583d379d6d685fa6 | |
| parent | f736532d947ccf0048d02c471a74b72b11b3d613 (diff) | |
| parent | 97e21b4bd83332cb58ac0ca86057762c9c41f4f8 (diff) | |
Merge pull request #8082 from donaldsharp/nhrp_priv
new clang fixes
| -rw-r--r-- | bgpd/bgp_mplsvpn_snmp.c | 4 | ||||
| -rw-r--r-- | bgpd/bgp_snmp.c | 8 | ||||
| -rw-r--r-- | lib/agentx.c | 16 | ||||
| -rw-r--r-- | lib/smux.h | 6 | ||||
| -rw-r--r-- | nhrpd/nhrp_main.c | 9 |
5 files changed, 24 insertions, 19 deletions
diff --git a/bgpd/bgp_mplsvpn_snmp.c b/bgpd/bgp_mplsvpn_snmp.c index ef5556be17..055bae8432 100644 --- a/bgpd/bgp_mplsvpn_snmp.c +++ b/bgpd/bgp_mplsvpn_snmp.c @@ -1427,13 +1427,13 @@ static struct bgp_path_info *bgpL3vpnRte_lookup(struct variable *v, oid name[], nexthop.ipa_type = IPADDR_V4; oid2in_addr(&name[i], sizeof(struct in_addr), &nexthop.ip._v4_addr); - i += sizeof(struct in_addr); + /* i += sizeof(struct in_addr); */ break; case INETADDRESSTYPEIPV6: nexthop.ipa_type = IPADDR_V6; oid2in_addr(&name[i], sizeof(struct in6_addr), &nexthop.ip._v4_addr); /* sic */ - i += sizeof(struct in6_addr); + /* i += sizeof(struct in6_addr); */ break; } } diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c index 00d225bf65..71868abc5f 100644 --- a/bgpd/bgp_snmp.c +++ b/bgpd/bgp_snmp.c @@ -870,10 +870,10 @@ static int bgpTrapEstablished(struct peer *peer) oid_copy_addr(index, &addr, IN_ADDR_SIZE); - ret = smux_trap(bgp_variables, array_size(bgp_variables), bgp_trap_oid, - array_size(bgp_trap_oid), bgp_oid, - sizeof(bgp_oid) / sizeof(oid), index, IN_ADDR_SIZE, - bgpTrapList, array_size(bgpTrapList), BGPESTABLISHED); + smux_trap(bgp_variables, array_size(bgp_variables), bgp_trap_oid, + array_size(bgp_trap_oid), bgp_oid, + sizeof(bgp_oid) / sizeof(oid), index, IN_ADDR_SIZE, + bgpTrapList, array_size(bgpTrapList), BGPESTABLISHED); return 0; } diff --git a/lib/agentx.c b/lib/agentx.c index dfe5d93754..5351f8bda2 100644 --- a/lib/agentx.c +++ b/lib/agentx.c @@ -265,11 +265,11 @@ void smux_register_mib(const char *descr, struct variable *var, size_t width, register_mib(descr, var, width, num, name, namelen); } -int smux_trap(struct variable *vp, size_t vp_len, const oid *ename, - size_t enamelen, const oid *name, size_t namelen, - const oid *iname, size_t inamelen, - const struct trap_object *trapobj, size_t trapobjlen, - uint8_t sptrap) +void smux_trap(struct variable *vp, size_t vp_len, const oid *ename, + size_t enamelen, const oid *name, size_t namelen, + const oid *iname, size_t inamelen, + const struct trap_object *trapobj, size_t trapobjlen, + uint8_t sptrap) { struct index_oid trap_index[1]; @@ -277,9 +277,9 @@ int smux_trap(struct variable *vp, size_t vp_len, const oid *ename, oid_copy(trap_index[0].indexname, iname, inamelen); trap_index[0].indexlen = inamelen; - return (smux_trap_multi_index( - vp, vp_len, ename, enamelen, name, namelen, trap_index, - array_size(trap_index), trapobj, trapobjlen, sptrap)); + smux_trap_multi_index(vp, vp_len, ename, enamelen, name, namelen, + trap_index, array_size(trap_index), trapobj, + trapobjlen, sptrap); } int smux_trap_multi_index(struct variable *vp, size_t vp_len, const oid *ename, diff --git a/lib/smux.h b/lib/smux.h index ff97c8ab51..e07df2369f 100644 --- a/lib/smux.h +++ b/lib/smux.h @@ -131,9 +131,9 @@ extern int smux_header_table(struct variable *, oid *, size_t *, int, size_t *, The use of the arguments may differ depending on the implementation used. */ -extern int smux_trap(struct variable *, size_t, const oid *, size_t, - const oid *, size_t, const oid *, size_t, - const struct trap_object *, size_t, uint8_t); +extern void smux_trap(struct variable *, size_t, const oid *, size_t, + const oid *, size_t, const oid *, size_t, + const struct trap_object *, size_t, uint8_t); extern int smux_trap_multi_index(struct variable *vp, size_t vp_len, const oid *ename, size_t enamelen, diff --git a/nhrpd/nhrp_main.c b/nhrpd/nhrp_main.c index 9fc13761c8..49a4900bf8 100644 --- a/nhrpd/nhrp_main.c +++ b/nhrpd/nhrp_main.c @@ -144,8 +144,13 @@ int main(int argc, char **argv) nhrp_interface_init(); resolver_init(master); - /* Run with elevated capabilities, as for all netlink activity - * we need privileges anyway. */ + /* + * Run with elevated capabilities, as for all netlink activity + * we need privileges anyway. + * The assert is for clang SA code where it does + * not see the change function being set in lib + */ + assert(nhrpd_privs.change); nhrpd_privs.change(ZPRIVS_RAISE); netlink_init(); |
