Fix verify_rev_path() function. The author of this function tried to
cut corners which completely broke down when the routing table locking was introduced. Reviewed by: sam (mentor) Approved by: re (rwatson)
This commit is contained in:
parent
7633e7f1a2
commit
623f556031
@ -453,22 +453,16 @@ iface_match(struct ifnet *ifp, ipfw_insn_if *cmd)
|
||||
static int
|
||||
verify_rev_path(struct in_addr src, struct ifnet *ifp)
|
||||
{
|
||||
static struct route ro;
|
||||
struct route ro;
|
||||
struct sockaddr_in *dst;
|
||||
|
||||
bzero(&ro, sizeof(ro));
|
||||
|
||||
dst = (struct sockaddr_in *)&(ro.ro_dst);
|
||||
|
||||
/* Check if we've cached the route from the previous call. */
|
||||
if (src.s_addr != dst->sin_addr.s_addr) {
|
||||
ro.ro_rt = NULL;
|
||||
|
||||
bzero(dst, sizeof(*dst));
|
||||
dst->sin_family = AF_INET;
|
||||
dst->sin_len = sizeof(*dst);
|
||||
dst->sin_addr = src;
|
||||
|
||||
rtalloc_ign(&ro, RTF_CLONING);
|
||||
}
|
||||
dst->sin_family = AF_INET;
|
||||
dst->sin_len = sizeof(*dst);
|
||||
dst->sin_addr = src;
|
||||
rtalloc_ign(&ro, RTF_CLONING);
|
||||
|
||||
if (ro.ro_rt == NULL)
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user