#ifdef IPPROTO_OSPFIGP before expecting it to be defined.
This unbreaks OpenBSD.
This commit is contained in:
parent
f3a6a64e4a
commit
62e85934b8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=49374
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: filter.c,v 1.33 1999/07/28 03:01:51 brian Exp $
|
||||
* $Id: filter.c,v 1.34 1999/08/02 11:53:16 brian Exp $
|
||||
*
|
||||
* TODO: Shoud send ICMP error message when we discard packets.
|
||||
*/
|
||||
@ -277,6 +277,7 @@ ParseIgmp(int argc, char const * const *argv, struct filterent *tgt)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef P_OSPF
|
||||
static int
|
||||
ParseOspf(int argc, char const * const *argv, struct filterent *tgt)
|
||||
{
|
||||
@ -292,6 +293,7 @@ ParseOspf(int argc, char const * const *argv, struct filterent *tgt)
|
||||
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static unsigned
|
||||
addrtype(const char *addr)
|
||||
@ -451,9 +453,11 @@ Parse(struct ipcp *ipcp, int argc, char const *const *argv,
|
||||
case P_IGMP:
|
||||
val = ParseIgmp(argc, argv, &filterdata);
|
||||
break;
|
||||
#ifdef P_OSPF
|
||||
case P_OSPF:
|
||||
val = ParseOspf(argc, argv, &filterdata);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
log_Printf(LogDEBUG, "Parse: Src: %s\n", inet_ntoa(filterdata.f_src.ipaddr));
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: filter.h,v 1.17 1999/07/27 23:43:59 brian Exp $
|
||||
* $Id: filter.h,v 1.18 1999/08/02 11:53:16 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -25,7 +25,9 @@
|
||||
#define P_TCP 1
|
||||
#define P_UDP 2
|
||||
#define P_ICMP 3
|
||||
#ifdef IPPROTO_OSPFIGP
|
||||
#define P_OSPF 4
|
||||
#endif
|
||||
#define P_IGMP 5
|
||||
|
||||
/* Operations - f_srcop, f_dstop */
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: ip.c,v 1.65 1999/07/27 23:43:59 brian Exp $
|
||||
* $Id: ip.c,v 1.66 1999/08/02 11:53:16 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Return ICMP message for filterd packet
|
||||
@ -179,6 +179,7 @@ FilterCheck(const struct ip *pip, const struct filter *filter)
|
||||
estab = syn = finrst = -1;
|
||||
sport = ntohs(0);
|
||||
break;
|
||||
#ifdef IPPROTO_OSPFIGP
|
||||
case IPPROTO_OSPFIGP:
|
||||
cproto = P_OSPF;
|
||||
if (datalen < 8) /* IGMP uses 8-octet messages */
|
||||
@ -186,6 +187,7 @@ FilterCheck(const struct ip *pip, const struct filter *filter)
|
||||
estab = syn = finrst = -1;
|
||||
sport = ntohs(0);
|
||||
break;
|
||||
#endif
|
||||
case IPPROTO_UDP:
|
||||
case IPPROTO_IPIP:
|
||||
cproto = P_UDP;
|
||||
@ -357,6 +359,7 @@ PacketCheck(struct bundle *bundle, char *cp, int nb, struct filter *filter)
|
||||
loglen += strlen(logbuf + loglen);
|
||||
}
|
||||
break;
|
||||
#ifdef IPPROTO_OSPFIGP
|
||||
case IPPROTO_OSPFIGP:
|
||||
if (logit && loglen < sizeof logbuf) {
|
||||
snprintf(logbuf + loglen, sizeof logbuf - loglen,
|
||||
@ -367,6 +370,7 @@ PacketCheck(struct bundle *bundle, char *cp, int nb, struct filter *filter)
|
||||
loglen += strlen(logbuf + loglen);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case IPPROTO_IPIP:
|
||||
if (logit && loglen < sizeof logbuf) {
|
||||
uh = (struct udphdr *) ptop;
|
||||
|
Loading…
Reference in New Issue
Block a user