Skip to content

Commit

Permalink
Revert "bgpd: fix pointer arithmetic in bgp snmp module"
Browse files Browse the repository at this point in the history
This reverts commit d9bd9eb.

The previous code was correct even if the coverity scanner was
complaining.

Fixes: FRRouting#15680
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
  • Loading branch information
louis-6wind committed Apr 23, 2024
1 parent c7895ba commit c1124a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bgpd/bgp_snmp_bgp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ static struct bgp_path_info *bgp4PathAttrLookup(struct variable *v, oid name[],
/* Set OID offset for prefix. */
offset = name + v->namelen;
oid2in_addr(offset, IN_ADDR_SIZE, &addr->prefix);
offset++;
offset += IN_ADDR_SIZE;

/* Prefix length. */
addr->prefixlen = *offset;
Expand Down Expand Up @@ -497,7 +497,7 @@ static struct bgp_path_info *bgp4PathAttrLookup(struct variable *v, oid name[],

offset = name + v->namelen;
oid_copy_in_addr(offset, &rn_p->u.prefix4);
offset++;
offset += IN_ADDR_SIZE;
*offset = rn_p->prefixlen;
offset++;
oid_copy_in_addr(offset,
Expand Down

0 comments on commit c1124a4

Please sign in to comment.