Skip to content

Conversation

@SolidWallOfCode
Copy link
Member

@SolidWallOfCode SolidWallOfCode commented Dec 18, 2023

This is in preparation for some significant ATS updates, including

  • Avoiding ats_ip_copy
  • Final removal of the old Errata
  • Replacement of Arena by MemArena.

Release notes:

Just in time for the holidays, a new release of libSWOC! This is a bit bigger than other recent point releases due to increased integration in ATS.

  • Fixed possible overflow bug in svtoi.
  • IP networking support
    • Generalization of network category (multicast, private, etc.).
    • Better endian handling.
    • Added some missing / unimplemented methods.
  • Errata: Auto text support for error codes in constructor and note method.
  • MemArena - support discard allocated spans.

Fixes #10934

@SolidWallOfCode SolidWallOfCode added this to the 10.0.0 milestone Dec 18, 2023
@SolidWallOfCode SolidWallOfCode self-assigned this Dec 18, 2023
*/
self_type &note(Severity severity, std::string_view text);

/** Add an @c Annotation to the top with @a text and local @a severity.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text? cut-n-paste error?

}

inline bool
IPAddr::operator==(self_type const &that) const {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self_type has more characters than IPAddr. Are you having a hard time staying busy in retirement?

protected:
IP4Addr _addr; ///< Address.
in_port_t _port = 0; ///< Port.
in_port_t _port = 0; ///< Port [host order].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why [ host order] not (host order)?

self_type &assign(IP6Addr const &addr, in_port_t port);

/** Change the address and port.
/** Assogm address amd [prt/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wha?


size_t _active_allocated = 0; ///< Total allocations in the active generation.
size_t _active_reserved = 0; ///< Total current reserved memory.
size_t _active_reserved = 0; ///< Total reserved memory (allocated from OS).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you mean "allocated from the compiler runtime library allocator"?

uintmax_t
svto_radix(TextView &src) {
static_assert(0 < RADIX && RADIX <= 36, "Radix must be in the range 1..36");
static_assert(1 <= RADIX && RADIX <= 36, "Radix must be in the range 2..36");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be 1 < RADIX

}

inline bool is_link_local_host_order(in_addr_t addr) {
return (addr & 0xFFFF0000) == 0xA9FE0000; // 169.254.0.0/16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

((169 << 24)|(254 << 16)) is less error-prone.

return (addr.s6_addr[0] & 0xFE) == 0xFC; // fc00::/7
}

#if BYTE_ORDER == LITTLE_ENDIAN
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be more robust to use:
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__

https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html

}
}
}
if (!(1 <= base && base <= 36)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can you have a base 1 number representation?

@maskit
Copy link
Member

maskit commented Dec 20, 2023

We don't make local changes for libswoc on ATS repo, right? If 1.5.9 has issues we simply don't use the version, and hope a new version doesn't have issues. Also, code change for libsowc should be reviewed on its repo but not here.

@bneradt
Copy link
Contributor

bneradt commented Jan 3, 2024

We don't make local changes for libswoc on ATS repo, right? If 1.5.9 has issues we simply don't use the version, and hope a new version doesn't have issues. Also, code change for libsowc should be reviewed on its repo but not here.

Correct. I'm going to go ahead and merge this in before things conflict with it.

@bneradt bneradt merged commit 38e8118 into apache:master Jan 3, 2024
phongn pushed a commit to phongn/trafficserver that referenced this pull request Feb 1, 2024
This is in preparation for some significant ATS updates, including

* Avoiding ats_ip_copy
* Final removal of the old Errata
* Replacement of Arena by MemArena.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fuzzing: negation can result in overflow inside TextView::svtoi

4 participants