-/* $OpenBSD: bfd.c,v 1.78 2021/09/14 09:15:55 mvs Exp $ */
+/* $OpenBSD: bfd.c,v 1.79 2023/07/12 16:10:45 mvs Exp $ */
/*
* Copyright (c) 2016-2018 Peter Hessler <phessler@openbsd.org>
struct socket *so;
struct mbuf *m = NULL, *mopt = NULL;
int *ip, error;
- int s;
/* sa_family and sa_len must be equal */
if (src->sa_family != dst->sa_family || src->sa_len != dst->sa_len)
mopt->m_len = sizeof(int);
ip = mtod(mopt, int *);
*ip = MAXTTL;
- s = solock(so);
+ solock(so);
error = sosetopt(so, IPPROTO_IP, IP_MINTTL, mopt);
- sounlock(so, s);
+ sounlock(so);
m_freem(mopt);
if (error) {
printf("%s: sosetopt error %d\n",
break;
}
- s = solock(so);
+ solock(so);
error = sobind(so, m, p);
- sounlock(so, s);
+ sounlock(so);
if (error) {
printf("%s: sobind error %d\n",
__func__, error);
struct sockaddr_in6 *sin6;
struct sockaddr_in *sin;
int error, *ip;
- int s;
/* sa_family and sa_len must be equal */
if (src->sa_family != dst->sa_family || src->sa_len != dst->sa_len)
mopt->m_len = sizeof(int);
ip = mtod(mopt, int *);
*ip = IP_PORTRANGE_HIGH;
- s = solock(so);
+ solock(so);
error = sosetopt(so, IPPROTO_IP, IP_PORTRANGE, mopt);
- sounlock(so, s);
+ sounlock(so);
m_freem(mopt);
if (error) {
printf("%s: sosetopt error %d\n",
mopt->m_len = sizeof(int);
ip = mtod(mopt, int *);
*ip = MAXTTL;
- s = solock(so);
+ solock(so);
error = sosetopt(so, IPPROTO_IP, IP_TTL, mopt);
- sounlock(so, s);
+ sounlock(so);
m_freem(mopt);
if (error) {
printf("%s: sosetopt error %d\n",
mopt->m_len = sizeof(int);
ip = mtod(mopt, int *);
*ip = IPTOS_PREC_INTERNETCONTROL;
- s = solock(so);
+ solock(so);
error = sosetopt(so, IPPROTO_IP, IP_TOS, mopt);
- sounlock(so, s);
+ sounlock(so);
m_freem(mopt);
if (error) {
printf("%s: sosetopt error %d\n",
break;
}
- s = solock(so);
+ solock(so);
error = sobind(so, m, p);
- sounlock(so, s);
+ sounlock(so);
if (error) {
printf("%s: sobind error %d\n",
__func__, error);
break;
}
- s = solock(so);
+ solock(so);
error = soconnect(so, m);
- sounlock(so, s);
+ sounlock(so);
if (error && error != ECONNREFUSED) {
printf("%s: soconnect error %d\n",
__func__, error);