Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net to be consistent with other sources, use "struct ip ...



details:   https://anonhg.NetBSD.org/src/rev/f133b1dc0344
branches:  trunk
changeset: 535214:f133b1dc0344
user:      itojun <itojun%NetBSD.org@localhost>
date:      Mon Aug 12 05:22:57 2002 +0000

description:
to be consistent with other sources, use "struct ip *ip", not inp.
(inp is usually used for pointing struct inpcb)

diffstat:

 sys/net/if_gre.c |  38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diffs (113 lines):

diff -r 37c3c85a5942 -r f133b1dc0344 sys/net/if_gre.c
--- a/sys/net/if_gre.c  Mon Aug 12 03:45:25 2002 +0000
+++ b/sys/net/if_gre.c  Mon Aug 12 05:22:57 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_gre.c,v 1.40 2002/06/10 17:40:26 itojun Exp $ */
+/*     $NetBSD: if_gre.c,v 1.41 2002/08/12 05:22:57 itojun Exp $ */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.40 2002/06/10 17:40:26 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.41 2002/08/12 05:22:57 itojun Exp $");
 
 #include "opt_inet.h"
 #include "opt_ns.h"
@@ -187,7 +187,7 @@
        int error = 0;
        struct gre_softc *sc = ifp->if_softc;
        struct greip *gh;
-       struct ip *inp;
+       struct ip *ip;
        u_char osrc;
        u_short etype = 0;
        struct mobile_h mob_h;
@@ -200,7 +200,7 @@
        }
 
        gh = NULL;
-       inp = NULL;
+       ip = NULL;
        osrc = 0;
 
 #if NBPFILTER >0
@@ -224,24 +224,24 @@
                        struct mbuf *m0;
                        int msiz;
 
-                       inp = mtod(m, struct ip *);
+                       ip = mtod(m, struct ip *);
 
                        memset(&mob_h, 0, MOB_H_SIZ_L);
-                       mob_h.proto = (inp->ip_p) << 8;
-                       mob_h.odst = inp->ip_dst.s_addr;
-                       inp->ip_dst.s_addr = sc->g_dst.s_addr;
+                       mob_h.proto = (ip->ip_p) << 8;
+                       mob_h.odst = ip->ip_dst.s_addr;
+                       ip->ip_dst.s_addr = sc->g_dst.s_addr;
 
                        /*
                         * If the packet comes from our host, we only change
                         * the destination address in the IP header.
                         * Else we also need to save and change the source
                         */
-                       if (in_hosteq(inp->ip_src, sc->g_src)) {
+                       if (in_hosteq(ip->ip_src, sc->g_src)) {
                                msiz = MOB_H_SIZ_S;
                        } else {
                                mob_h.proto |= MOB_H_SBIT;
-                               mob_h.osrc = inp->ip_src.s_addr;
-                               inp->ip_src.s_addr = sc->g_src.s_addr;
+                               mob_h.osrc = ip->ip_src.s_addr;
+                               ip->ip_src.s_addr = sc->g_src.s_addr;
                                msiz = MOB_H_SIZ_L;
                        }
                        HTONS(mob_h.proto);
@@ -262,20 +262,20 @@
                                m0->m_pkthdr.len = m->m_pkthdr.len + msiz;
                                m0->m_len = msiz + sizeof(struct ip);
                                m0->m_data += max_linkhdr;
-                               memcpy(mtod(m0, caddr_t), (caddr_t)inp,
+                               memcpy(mtod(m0, caddr_t), (caddr_t)ip,
                                       sizeof(struct ip));
                                m = m0;
                        } else {  /* we have some space left in the old one */
                                m->m_data -= msiz;
                                m->m_len += msiz;
                                m->m_pkthdr.len += msiz;
-                               memmove(mtod(m, caddr_t), inp,
+                               memmove(mtod(m, caddr_t), ip,
                                        sizeof(struct ip));
                        }
-                       inp = mtod(m, struct ip *);
-                       memcpy((caddr_t)(inp + 1), &mob_h, (unsigned)msiz);
-                       NTOHS(inp->ip_len);
-                       inp->ip_len += msiz;
+                       ip = mtod(m, struct ip *);
+                       memcpy((caddr_t)(ip + 1), &mob_h, (unsigned)msiz);
+                       NTOHS(ip->ip_len);
+                       ip->ip_len += msiz;
                } else {  /* AF_INET */
                        IF_DROP(&ifp->if_snd);
                        m_freem(m);
@@ -285,7 +285,7 @@
        } else if (sc->g_proto == IPPROTO_GRE) {
                switch (dst->sa_family) {
                case AF_INET:
-                       inp = mtod(m, struct ip *);
+                       ip = mtod(m, struct ip *);
                        etype = ETHERTYPE_IP;
                        break;
 #ifdef NETATALK
@@ -332,7 +332,7 @@
                gh->gi_dst = sc->g_dst;
                ((struct ip*)gh)->ip_hl = (sizeof(struct ip)) >> 2;
                ((struct ip*)gh)->ip_ttl = ip_gre_ttl;
-               ((struct ip*)gh)->ip_tos = inp->ip_tos;
+               ((struct ip*)gh)->ip_tos = ip->ip_tos;
                gh->gi_len = m->m_pkthdr.len;
        }
 



Home | Main Index | Thread Index | Old Index