Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
icerrok.c
Package: icmp.rar [view]
Upload User: lywr2008
Upload Date: 2022-05-26
Package Size: 9k
Code Size: 1k
Category:
Linux Network
Development Platform:
Unix_Linux
- /* icerrok.c - icerrok */
- #include <conf.h>
- #include <kernel.h>
- #include <network.h>
- /*------------------------------------------------------------------------
- * icerrok - is it ok to send an error response?
- *------------------------------------------------------------------------
- */
- Bool
- icerrok(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;
- }