summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/ip.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-09-30 07:23:13 +0000
committerbrian <brian@FreeBSD.org>1999-09-30 07:23:13 +0000
commitf3bceef566234685610dbdd666fe891f89f4501d (patch)
tree122b4ca632e7da2408474ec5e53ecb4c582a3f96 /usr.sbin/ppp/ip.c
parent1fc218b67628314fd94ac6b188a33a35873298be (diff)
downloadFreeBSD-src-f3bceef566234685610dbdd666fe891f89f4501d.zip
FreeBSD-src-f3bceef566234685610dbdd666fe891f89f4501d.tar.gz
Support GRE packets
Submitted by: Harry Starr <starr@gccs.com.au>
Diffstat (limited to 'usr.sbin/ppp/ip.c')
-rw-r--r--usr.sbin/ppp/ip.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/usr.sbin/ppp/ip.c b/usr.sbin/ppp/ip.c
index f1219d0..2e5f00c 100644
--- a/usr.sbin/ppp/ip.c
+++ b/usr.sbin/ppp/ip.c
@@ -170,6 +170,15 @@ FilterCheck(const struct ip *pip, const struct filter *filter)
estab = syn = finrst = -1;
sport = ntohs(0);
break;
+#ifdef IPPROTO_GRE
+ case IPPROTO_GRE:
+ cproto = P_GRE;
+ if (datalen < 2) /* GRE uses 2-octet+ messages */
+ return (1);
+ estab = syn = finrst = -1;
+ sport = ntohs(0);
+ break;
+#endif
#ifdef IPPROTO_OSPFIGP
case IPPROTO_OSPFIGP:
cproto = P_OSPF;
@@ -360,6 +369,19 @@ PacketCheck(struct bundle *bundle, char *cp, int nb, struct filter *filter)
}
break;
+#ifdef IPPROTO_GRE
+ case IPPROTO_GRE:
+ if (logit && loglen < sizeof logbuf) {
+ snprintf(logbuf + loglen, sizeof logbuf - loglen,
+ "GRE: %s ---> ", inet_ntoa(pip->ip_src));
+ loglen += strlen(logbuf + loglen);
+ snprintf(logbuf + loglen, sizeof logbuf - loglen,
+ "%s", inet_ntoa(pip->ip_dst));
+ loglen += strlen(logbuf + loglen);
+ }
+ break;
+#endif
+
#ifdef IPPROTO_OSPFIGP
case IPPROTO_OSPFIGP:
if (logit && loglen < sizeof logbuf) {
OpenPOWER on IntegriCloud