---
name: "ipsec_strerror"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/ipsec_strerror"
---

# ipsec\_strerror(3)

error messages for the IPsec policy manipulation library

## NAME

**ipsec\_strerror** – error messages for the IPsec policy manipulation library

## SYNOPSIS

**#include \<netipsec/ipsec.h\>**

*const char \**\

**ipsec\_strerror**();

## DESCRIPTION

⟨netipsec/ipsec.h⟩ declares

```
extern int ipsec_errcode;
```

which is used to pass an error code from IPsec policy manipulation library to a user program. The **ipsec\_strerror**() function can be used to obtain the error message string for the error code.

The array pointed to is not to be modified by the program. Since **ipsec\_strerror**() uses [strerror(3)](/strerror/3.md) as an underlying function, calling [strerror(3)](/strerror/3.md) after **ipsec\_strerror**() would overwrite the return value from **ipsec\_strerror**() and make it invalid.

## RETURN VALUES

The **ipsec\_strerror**() function always returns a pointer to C string. The C string must not be overwritten by the caller.

## SEE ALSO

[ipsec\_set\_policy(3)](/ipsec_set_policy/3.md)

## HISTORY

The **ipsec\_strerror**() function first appeared in WIDE/KAME IPv6 protocol stack kit.

## BUGS

The **ipsec\_strerror**() function will return its result which may be overwritten by subsequent calls.

*ipsec\_errcode* is not thread safe.
