icerrok.c,v
来自「TCP-IP红宝书源代码」· C,V 代码 · 共 64 行
C,V
64 行
head 1.1;
access;
symbols;
locks
dls:1.1; strict;
comment @ * @;
1.1
date 97.09.21.19.26.41; author dls; state Dist;
branches;
next ;
desc
@@
1.1
log
@pre-3e code
@
text
@/* icerrok.c - icerrok */
#include <conf.h>
#include <kernel.h>
#include <network.h>
/*------------------------------------------------------------------------
* icerrok - is it ok to send an error response?
*------------------------------------------------------------------------
*/
Bool icerrok(pep)
struct ep *pep;
{
struct ip *pip = (struct ip *)pep->ep_data;
struct icmp *pic = (struct icmp *)pip->ip_data;
/* don't send errors about error packets... */
if (pip->ip_proto == IPT_ICMP)
switch(pic->ic_type) {
case ICT_DESTUR:
case ICT_REDIRECT:
case ICT_SRCQ:
case ICT_TIMEX:
case ICT_PARAMP:
return FALSE;
default:
break;
}
/* ...or other than the first of a fragment */
if (pip->ip_fragoff & IP_FRAGOFF)
return FALSE;
/* ...or broadcast or multicast packets */
if (isbrc(pip->ip_dst) || IP_CLASSD(pip->ip_dst))
return FALSE;
return TRUE;
}
@
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?