From: lteo Date: Sun, 10 Aug 2014 03:24:51 +0000 (+0000) Subject: Rename p_hdrlen to min_hdrlen to better reflect its purpose. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c2ebc0c102f70a4408934b508f6ded7807428df3;p=openbsd Rename p_hdrlen to min_hdrlen to better reflect its purpose. No object file change ok florian@ henning@ --- diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 83ebbf5af0c..3547df8c519 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_divert.c,v 1.27 2014/07/22 11:06:10 mpi Exp $ */ +/* $OpenBSD: ip_divert.c,v 1.28 2014/08/10 03:24:51 lteo Exp $ */ /* * Copyright (c) 2009 Michele Marchetto @@ -84,7 +84,7 @@ divert_output(struct inpcb *inp, struct mbuf *m, struct mbuf *nam, struct sockaddr_in *sin; struct socket *so; struct ifaddr *ifa; - int s, error = 0, p_hdrlen = 0, dir; + int s, error = 0, min_hdrlen = 0, dir; struct ip *ip; u_int16_t off; @@ -118,22 +118,22 @@ divert_output(struct inpcb *inp, struct mbuf *m, struct mbuf *nam, switch (ip->ip_p) { case IPPROTO_TCP: - p_hdrlen = sizeof(struct tcphdr); + min_hdrlen = sizeof(struct tcphdr); m->m_pkthdr.csum_flags |= M_TCP_CSUM_OUT; break; case IPPROTO_UDP: - p_hdrlen = sizeof(struct udphdr); + min_hdrlen = sizeof(struct udphdr); m->m_pkthdr.csum_flags |= M_UDP_CSUM_OUT; break; case IPPROTO_ICMP: - p_hdrlen = sizeof(struct icmp); + min_hdrlen = sizeof(struct icmp); m->m_pkthdr.csum_flags |= M_ICMP_CSUM_OUT; break; default: /* nothing */ break; } - if (p_hdrlen && m->m_pkthdr.len < off + p_hdrlen) + if (min_hdrlen && m->m_pkthdr.len < off + min_hdrlen) goto fail; m->m_pkthdr.pf.flags |= PF_TAG_DIVERTED_PACKET; diff --git a/sys/netinet6/ip6_divert.c b/sys/netinet6/ip6_divert.c index b817eb433e3..a734734c9cc 100644 --- a/sys/netinet6/ip6_divert.c +++ b/sys/netinet6/ip6_divert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_divert.c,v 1.28 2014/07/22 11:06:10 mpi Exp $ */ +/* $OpenBSD: ip6_divert.c,v 1.29 2014/08/10 03:24:51 lteo Exp $ */ /* * Copyright (c) 2009 Michele Marchetto @@ -88,7 +88,7 @@ divert6_output(struct inpcb *inp, struct mbuf *m, struct mbuf *nam, struct sockaddr_in6 *sin6; struct socket *so; struct ifaddr *ifa; - int s, error = 0, p_hdrlen = 0, nxt = 0, off, dir; + int s, error = 0, min_hdrlen = 0, nxt = 0, off, dir; struct ip6_hdr *ip6; m->m_pkthdr.rcvif = NULL; @@ -127,22 +127,22 @@ divert6_output(struct inpcb *inp, struct mbuf *m, struct mbuf *nam, switch (nxt) { case IPPROTO_TCP: - p_hdrlen = sizeof(struct tcphdr); + min_hdrlen = sizeof(struct tcphdr); m->m_pkthdr.csum_flags |= M_TCP_CSUM_OUT; break; case IPPROTO_UDP: - p_hdrlen = sizeof(struct udphdr); + min_hdrlen = sizeof(struct udphdr); m->m_pkthdr.csum_flags |= M_UDP_CSUM_OUT; break; case IPPROTO_ICMPV6: - p_hdrlen = sizeof(struct icmp6_hdr); + min_hdrlen = sizeof(struct icmp6_hdr); m->m_pkthdr.csum_flags |= M_ICMP_CSUM_OUT; break; default: /* nothing */ break; } - if (p_hdrlen && m->m_pkthdr.len < off + p_hdrlen) + if (min_hdrlen && m->m_pkthdr.len < off + min_hdrlen) goto fail; m->m_pkthdr.pf.flags |= PF_TAG_DIVERTED_PACKET;