Deleted Added
full compact
1,2c1,2
< /* $NetBSD: ip_gre.c,v 1.21 2002/08/14 00:23:30 itojun Exp $ */
< /* $FreeBSD: head/sys/netinet/ip_gre.c 123922 2003-12-28 03:56:00Z sam $ */
---
> /* $NetBSD: ip_gre.c,v 1.29 2003/09/05 23:02:43 itojun Exp $ */
> /* $FreeBSD: head/sys/netinet/ip_gre.c 123992 2003-12-30 11:41:43Z sobomax $ */
108,109c108,109
< struct mbuf *m;
< va_dcl
---
> struct mbuf *m;
> va_dcl
138d137
<
142c141
< struct greip *gip = mtod(m, struct greip *);
---
> struct greip *gip;
145c144
< u_short flags;
---
> u_int16_t flags;
151a151,157
> if (m->m_len < sizeof(*gip)) {
> m = m_pullup(m, sizeof(*gip));
> if (m == NULL)
> return (ENOBUFS);
> }
> gip = mtod(m, struct greip *);
>
157c163
< hlen += sizeof (struct gre_h);
---
> hlen += sizeof(struct gre_h);
167c173
< return(0);
---
> return (0);
171c177
< hlen +=4;
---
> hlen += 4;
186c192
< return(0);
---
> return (0);
191c197
< return(0);
---
> return (0);
194,195c200,204
< m->m_data += hlen;
< m->m_len -= hlen;
---
> if (hlen > m->m_pkthdr.len) {
> m_freem(m);
> return (EINVAL);
> }
> m_adj(m, hlen);
207c216
< return(1); /* packet is done, no further processing needed */
---
> return (1); /* packet is done, no further processing needed */
226,227c235,236
< struct ip *ip = mtod(m, struct ip *);
< struct mobip_h *mip = mtod(m, struct mobip_h *);
---
> struct ip *ip;
> struct mobip_h *mip;
231d239
< u_char osrc = 0;
234c242
< va_start(ap,m);
---
> va_start(ap, m);
243a252,259
> if (m->m_len < sizeof(*mip)) {
> m = m_pullup(m, sizeof(*mip));
> if (m == NULL)
> return;
> }
> ip = mtod(m, struct ip *);
> mip = mtod(m, struct mobip_h *);
>
247,248c263
< if(ntohs(mip->mh.proto) & MOB_H_SBIT) {
< osrc = 1;
---
> if (ntohs(mip->mh.proto) & MOB_H_SBIT) {
251c266
< } else {
---
> } else
252a268,274
>
> if (m->m_len < (ip->ip_hl << 2) + msiz) {
> m = m_pullup(m, (ip->ip_hl << 2) + msiz);
> if (m == NULL)
> return;
> ip = mtod(m, struct ip *);
> mip = mtod(m, struct mobip_h *);
253a276
>
257c280
< if (gre_in_cksum((u_short*)&mip->mh,msiz) != 0) {
---
> if (gre_in_cksum((u_int16_t *)&mip->mh, msiz) != 0) {