From: mvs Date: Sat, 8 Apr 2023 13:50:22 +0000 (+0000) Subject: Do not reload `inp' in gre_send(). The pointer to PCB of raw socket is X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=39dcd28483097402c2f5b0fb14acdcbe32e68732;p=openbsd Do not reload `inp' in gre_send(). The pointer to PCB of raw socket is immutable, we don't need to reload it again. ok bluhm@ --- diff --git a/sys/netinet/ip_gre.c b/sys/netinet/ip_gre.c index 2d2f929496e..aaecb6bfabd 100644 --- a/sys/netinet/ip_gre.c +++ b/sys/netinet/ip_gre.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_gre.c,v 1.85 2022/10/17 14:49:02 mvs Exp $ */ +/* $OpenBSD: ip_gre.c,v 1.86 2023/04/08 13:50:22 mvs Exp $ */ /* $NetBSD: ip_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */ /* @@ -88,11 +88,9 @@ gre_send(struct socket *so, struct mbuf *m, struct mbuf *nam, struct in_addr *ina_dst; ina_dst = NULL; - if ((so->so_state & SS_ISCONNECTED) != 0) { - inp = sotoinpcb(so); - if (inp) - ina_dst = &inp->inp_laddr; - } else if (nam) { + if ((so->so_state & SS_ISCONNECTED) != 0) + ina_dst = &inp->inp_laddr; + else if (nam) { if (in_nam2sin(nam, &sin4) == 0) ina_dst = &sin4->sin_addr; }