diff options
Diffstat (limited to 'ipsec-tools/src/libipsec/pfkey.c')
-rw-r--r-- | ipsec-tools/src/libipsec/pfkey.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ipsec-tools/src/libipsec/pfkey.c b/ipsec-tools/src/libipsec/pfkey.c index a621be12..cc6ad816 100644 --- a/ipsec-tools/src/libipsec/pfkey.c +++ b/ipsec-tools/src/libipsec/pfkey.c @@ -1,5 +1,12 @@ #include <machine/rtems-bsd-user-space.h> +#ifdef __rtems__ +/* Only need socket from rtems-bsd-program wrappers! */ +int +rtems_bsd_program_socket(int domain, int type, int protocol); +#define socket(domain, type, protocol) \ + rtems_bsd_program_socket(domain, type, protocol) +#endif /* __rtems__ */ /* $NetBSD: pfkey.c,v 1.21.2.1 2011/11/14 13:25:06 tteras Exp $ */ /* $KAME: pfkey.c,v 1.47 2003/10/02 19:52:12 itojun Exp $ */ @@ -1829,8 +1836,18 @@ pfkey_open(void) (void)setsockopt(so, SOL_SOCKET, SO_SNDBUF, &bufsiz_wanted, sizeof(bufsiz_wanted)); +#ifndef __rtems__ /* Try to have have at least 2MB. If we have more, do not lower it. */ bufsiz_wanted = 2 * 1024 * 1024; +#else /* __rtems__ */ + /* + * The bufsize_wanted has an influence on the maximum number of SPDs. We + * don't really need that much of them on an embedded system. If some + * application really needs it, this can be overwritten with the + * pfkey_buffer option in the config file. + */ + bufsiz_wanted = 128 * 1024; +#endif /* __rtems__ */ len = sizeof(bufsiz_current); ret = getsockopt(so, SOL_SOCKET, SO_RCVBUF, &bufsiz_current, &len); |