Changed the way we handle outgoing ICMP error messages -- do
not alias `ip_src' unless it comes from the host an original datagram that triggered this error message was destined for. PR: 20712 Reviewed by: brian, Charles Mott <cmott@scientech.com>
This commit is contained in:
parent
c344a8dd37
commit
f77a104cd3
@ -539,12 +539,17 @@ IcmpAliasOut2(struct ip *pip)
|
||||
accumulate -= alias_port;
|
||||
ADJUST_CHECKSUM(accumulate, ic->icmp_cksum)
|
||||
|
||||
/* Alias address in IP header */
|
||||
DifferentialChecksum(&pip->ip_sum,
|
||||
(u_short *) &alias_address,
|
||||
(u_short *) &pip->ip_src,
|
||||
2);
|
||||
pip->ip_src = alias_address;
|
||||
/*
|
||||
* Alias address in IP header if it comes from the host
|
||||
* the original TCP/UDP packet was destined for.
|
||||
*/
|
||||
if (pip->ip_src.s_addr == ip->ip_dst.s_addr) {
|
||||
DifferentialChecksum(&pip->ip_sum,
|
||||
(u_short *) &alias_address,
|
||||
(u_short *) &pip->ip_src,
|
||||
2);
|
||||
pip->ip_src = alias_address;
|
||||
}
|
||||
|
||||
/* Alias address and port number of original IP packet
|
||||
fragment contained in ICMP data section */
|
||||
@ -572,12 +577,17 @@ fragment contained in ICMP data section */
|
||||
accumulate -= alias_id;
|
||||
ADJUST_CHECKSUM(accumulate, ic->icmp_cksum)
|
||||
|
||||
/* Alias address in IP header */
|
||||
DifferentialChecksum(&pip->ip_sum,
|
||||
(u_short *) &alias_address,
|
||||
(u_short *) &pip->ip_src,
|
||||
2);
|
||||
pip->ip_src = alias_address;
|
||||
/*
|
||||
* Alias address in IP header if it comes from the host
|
||||
* the original ICMP message was destined for.
|
||||
*/
|
||||
if (pip->ip_src.s_addr == ip->ip_dst.s_addr) {
|
||||
DifferentialChecksum(&pip->ip_sum,
|
||||
(u_short *) &alias_address,
|
||||
(u_short *) &pip->ip_src,
|
||||
2);
|
||||
pip->ip_src = alias_address;
|
||||
}
|
||||
|
||||
/* Alias address of original IP packet and sequence number of
|
||||
embedded ICMP datagram */
|
||||
|
@ -539,12 +539,17 @@ IcmpAliasOut2(struct ip *pip)
|
||||
accumulate -= alias_port;
|
||||
ADJUST_CHECKSUM(accumulate, ic->icmp_cksum)
|
||||
|
||||
/* Alias address in IP header */
|
||||
DifferentialChecksum(&pip->ip_sum,
|
||||
(u_short *) &alias_address,
|
||||
(u_short *) &pip->ip_src,
|
||||
2);
|
||||
pip->ip_src = alias_address;
|
||||
/*
|
||||
* Alias address in IP header if it comes from the host
|
||||
* the original TCP/UDP packet was destined for.
|
||||
*/
|
||||
if (pip->ip_src.s_addr == ip->ip_dst.s_addr) {
|
||||
DifferentialChecksum(&pip->ip_sum,
|
||||
(u_short *) &alias_address,
|
||||
(u_short *) &pip->ip_src,
|
||||
2);
|
||||
pip->ip_src = alias_address;
|
||||
}
|
||||
|
||||
/* Alias address and port number of original IP packet
|
||||
fragment contained in ICMP data section */
|
||||
@ -572,12 +577,17 @@ fragment contained in ICMP data section */
|
||||
accumulate -= alias_id;
|
||||
ADJUST_CHECKSUM(accumulate, ic->icmp_cksum)
|
||||
|
||||
/* Alias address in IP header */
|
||||
DifferentialChecksum(&pip->ip_sum,
|
||||
(u_short *) &alias_address,
|
||||
(u_short *) &pip->ip_src,
|
||||
2);
|
||||
pip->ip_src = alias_address;
|
||||
/*
|
||||
* Alias address in IP header if it comes from the host
|
||||
* the original ICMP message was destined for.
|
||||
*/
|
||||
if (pip->ip_src.s_addr == ip->ip_dst.s_addr) {
|
||||
DifferentialChecksum(&pip->ip_sum,
|
||||
(u_short *) &alias_address,
|
||||
(u_short *) &pip->ip_src,
|
||||
2);
|
||||
pip->ip_src = alias_address;
|
||||
}
|
||||
|
||||
/* Alias address of original IP packet and sequence number of
|
||||
embedded ICMP datagram */
|
||||
|
Loading…
Reference in New Issue
Block a user