| version 1.141, 2011/11/19 22:51:25 |
version 1.142, 2011/12/12 00:06:39 |
| Line 501 in_control(struct socket *so, u_long cmd |
|
| Line 501 in_control(struct socket *so, u_long cmd |
|
| ifra->ifra_addr.sin_addr)) |
ifra->ifra_addr.sin_addr)) |
| hostIsNew = 0; |
hostIsNew = 0; |
| if (ifra->ifra_mask.sin_len) { |
if (ifra->ifra_mask.sin_len) { |
| in_ifscrub(ifp, ia); |
/* Only scrub if we control the prefix route, |
| |
* otherwise userland gets a bogus message */ |
| |
if ((ia->ia_flags & IFA_ROUTE)) |
| |
in_ifscrub(ifp, ia); |
| ia->ia_sockmask = ifra->ifra_mask; |
ia->ia_sockmask = ifra->ifra_mask; |
| ia->ia_subnetmask = ia->ia_sockmask.sin_addr.s_addr; |
ia->ia_subnetmask = ia->ia_sockmask.sin_addr.s_addr; |
| maskIsNew = 1; |
maskIsNew = 1; |
| } |
} |
| if ((ifp->if_flags & IFF_POINTOPOINT) && |
if ((ifp->if_flags & IFF_POINTOPOINT) && |
| (ifra->ifra_dstaddr.sin_family == AF_INET)) { |
(ifra->ifra_dstaddr.sin_family == AF_INET)) { |
| in_ifscrub(ifp, ia); |
/* Only scrub if we control the prefix route, |
| |
* otherwise userland gets a bogus message */ |
| |
if ((ia->ia_flags & IFA_ROUTE)) |
| |
in_ifscrub(ifp, ia); |
| ia->ia_dstaddr = ifra->ifra_dstaddr; |
ia->ia_dstaddr = ifra->ifra_dstaddr; |
| maskIsNew = 1; /* We lie; but the effect's the same */ |
maskIsNew = 1; /* We lie; but the effect's the same */ |
| } |
} |
| Line 923 in_addprefix(struct in_ifaddr *target, i |
|
| Line 929 in_addprefix(struct in_ifaddr *target, i |
|
| * interface address, we don't need to bother |
* interface address, we don't need to bother |
| * |
* |
| * XXX RADIX_MPATH implications here? -dyoung |
* XXX RADIX_MPATH implications here? -dyoung |
| |
* |
| |
* But we should still notify userland of the new address |
| */ |
*/ |
| if (ia->ia_flags & IFA_ROUTE) |
if (ia->ia_flags & IFA_ROUTE) { |
| |
rt_newaddrmsg(RTM_NEWADDR, &target->ia_ifa, 0, NULL); |
| return 0; |
return 0; |
| |
} |
| } |
} |
| |
|
| /* |
/* |
| Line 955 in_scrubprefix(struct in_ifaddr *target) |
|
| Line 965 in_scrubprefix(struct in_ifaddr *target) |
|
| struct in_addr prefix, mask, p; |
struct in_addr prefix, mask, p; |
| int error; |
int error; |
| |
|
| if ((target->ia_flags & IFA_ROUTE) == 0) |
/* If we don't have IFA_ROUTE we should still inform userland */ |
| |
if ((target->ia_flags & IFA_ROUTE) == 0) { |
| |
rt_newaddrmsg(RTM_DELADDR, &target->ia_ifa, 0, NULL); |
| return 0; |
return 0; |
| |
} |
| |
|
| if (rtinitflags(target)) |
if (rtinitflags(target)) |
| prefix = target->ia_dstaddr.sin_addr; |
prefix = target->ia_dstaddr.sin_addr; |