mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-03-06 22:13:18 +00:00
patch #6539: (configurable) response to broadcast- and multicast pings
This commit is contained in:
parent
14cb4eb735
commit
e001a021d5
@ -19,13 +19,17 @@ HISTORY
|
|||||||
|
|
||||||
++ New features:
|
++ New features:
|
||||||
|
|
||||||
|
2009-02-16 Simon Goldschmidt (patch by Rishi Khan)
|
||||||
|
* icmp.c, opt.h: patch #6539: (configurable) response to broadcast- and multicast
|
||||||
|
pings
|
||||||
|
|
||||||
2009-02-12 Simon Goldschmidt
|
2009-02-12 Simon Goldschmidt
|
||||||
* init.h: Added LWIP_VERSION to get the current version of the stack
|
* init.h: Added LWIP_VERSION to get the current version of the stack
|
||||||
|
|
||||||
2009-02-11 Simon Goldschmidt (suggested by Gottfried Spitaler)
|
2009-02-11 Simon Goldschmidt (suggested by Gottfried Spitaler)
|
||||||
* opt.h, memp.h/.c: added MEMP_MEM_MALLOC to use mem_malloc/mem_free instead
|
* opt.h, memp.h/.c: added MEMP_MEM_MALLOC to use mem_malloc/mem_free instead
|
||||||
of the pool allocator (can save code size with MEM_LIBC_MALLOC if libc-malloc
|
of the pool allocator (can save code size with MEM_LIBC_MALLOC if libc-malloc
|
||||||
is otherwise used)
|
is otherwise used)
|
||||||
|
|
||||||
2009-01-28 Jonathan Larmour (suggested by Bill Bauerbach)
|
2009-01-28 Jonathan Larmour (suggested by Bill Bauerbach)
|
||||||
* ipv4/inet_chksum.c, ipv4/lwip/inet_chksum.h: inet_chksum_pseudo_partial()
|
* ipv4/inet_chksum.c, ipv4/lwip/inet_chksum.h: inet_chksum_pseudo_partial()
|
||||||
|
@ -94,13 +94,30 @@ icmp_input(struct pbuf *p, struct netif *inp)
|
|||||||
#endif /* LWIP_DEBUG */
|
#endif /* LWIP_DEBUG */
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ICMP_ECHO:
|
case ICMP_ECHO:
|
||||||
/* broadcast or multicast destination address? */
|
#if !LWIP_MULTICAST_PING || !LWIP_BROADCAST_PING
|
||||||
if (ip_addr_isbroadcast(&iphdr->dest, inp) || ip_addr_ismulticast(&iphdr->dest)) {
|
{
|
||||||
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: Not echoing to multicast or broadcast pings\n"));
|
int accepted = 1;
|
||||||
ICMP_STATS_INC(icmp.err);
|
#if !LWIP_MULTICAST_PING
|
||||||
pbuf_free(p);
|
/* multicast destination address? */
|
||||||
return;
|
if (ip_addr_ismulticast(&iphdr->dest)) {
|
||||||
|
accepted = 0;
|
||||||
|
}
|
||||||
|
#endif /* LWIP_MULTICAST_PING */
|
||||||
|
#if !LWIP_BROADCAST_PING
|
||||||
|
/* broadcast destination address? */
|
||||||
|
if (ip_addr_isbroadcast(&iphdr->dest, inp)) {
|
||||||
|
accepted = 0;
|
||||||
|
}
|
||||||
|
#endif /* LWIP_BROADCAST_PING */
|
||||||
|
/* broadcast or multicast destination address not acceptd? */
|
||||||
|
if (!accepted) {
|
||||||
|
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: Not echoing to multicast or broadcast pings\n"));
|
||||||
|
ICMP_STATS_INC(icmp.err);
|
||||||
|
pbuf_free(p);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* !LWIP_MULTICAST_PING || !LWIP_BROADCAST_PING */
|
||||||
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ping\n"));
|
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ping\n"));
|
||||||
if (p->tot_len < sizeof(struct icmp_echo_hdr)) {
|
if (p->tot_len < sizeof(struct icmp_echo_hdr)) {
|
||||||
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: bad ICMP echo received\n"));
|
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: bad ICMP echo received\n"));
|
||||||
|
@ -461,6 +461,20 @@
|
|||||||
#define ICMP_TTL (IP_DEFAULT_TTL)
|
#define ICMP_TTL (IP_DEFAULT_TTL)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only)
|
||||||
|
*/
|
||||||
|
#ifndef LWIP_BROADCAST_PING
|
||||||
|
#define LWIP_BROADCAST_PING 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only)
|
||||||
|
*/
|
||||||
|
#ifndef LWIP_MULTICAST_PING
|
||||||
|
#define LWIP_MULTICAST_PING 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
---------------------------------
|
---------------------------------
|
||||||
---------- RAW options ----------
|
---------- RAW options ----------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user