mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-16 23:57:54 +01:00
Send ARP's for aliased subnets with the proper source address.
Get rid of ac->ac_ipaddr and arpwhohas() since they assume that an interface has only one address. Obtained from: BSD/OS 2.1, via Rich Stevens <rstevens@noao.edu>
This commit is contained in:
parent
4db1a958c0
commit
203f0c075f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14761
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)if_ether.c 8.1 (Berkeley) 6/10/93
|
||||
* $Id: if_ether.c,v 1.27 1996/02/05 18:04:30 wollman Exp $
|
||||
* $Id: if_ether.c,v 1.28 1996/02/20 17:54:17 fenner Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -106,7 +106,6 @@ static void arprequest __P((struct arpcom *, u_long *, u_long *, u_char *));
|
||||
static void arpintr __P((void));
|
||||
static void arptfree __P((struct llinfo_arp *));
|
||||
static void arptimer __P((void *));
|
||||
static void arpwhohas __P((struct arpcom *ac, struct in_addr *addr));
|
||||
static struct llinfo_arp
|
||||
*arplookup __P((u_long, int, int));
|
||||
static void in_arpinput __P((struct mbuf *));
|
||||
@ -258,16 +257,6 @@ arp_rtrequest(req, rt, sa)
|
||||
Free((caddr_t)la);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Broadcast an ARP packet, asking who has addr on interface ac.
|
||||
*/
|
||||
static void
|
||||
arpwhohas(ac, addr)
|
||||
struct arpcom *ac;
|
||||
struct in_addr *addr;
|
||||
{
|
||||
arprequest(ac, &ac->ac_ipaddr.s_addr, &addr->s_addr, ac->ac_enaddr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Broadcast an ARP request. Caller specifies:
|
||||
@ -375,7 +364,10 @@ arpresolve(ac, rt, m, dst, desten, rt0)
|
||||
if (la->la_asked == 0 || rt->rt_expire != time.tv_sec) {
|
||||
rt->rt_expire = time.tv_sec;
|
||||
if (la->la_asked++ < arp_maxtries)
|
||||
arpwhohas(ac, &(SIN(dst)->sin_addr));
|
||||
arprequest(ac,
|
||||
&(SIN(rt0->rt_ifa->ifa_addr)->sin_addr.s_addr),
|
||||
&(SIN(dst)->sin_addr.s_addr),
|
||||
ac->ac_enaddr);
|
||||
else {
|
||||
rt->rt_flags |= RTF_REJECT;
|
||||
rt->rt_expire += arpt_down;
|
||||
@ -634,8 +626,8 @@ arp_ifinit(ac, ifa)
|
||||
struct arpcom *ac;
|
||||
struct ifaddr *ifa;
|
||||
{
|
||||
ac->ac_ipaddr = IA_SIN(ifa)->sin_addr;
|
||||
arpwhohas(ac, &ac->ac_ipaddr);
|
||||
arprequest(ac, &(IA_SIN(ifa)->sin_addr.s_addr),
|
||||
&(IA_SIN(ifa)->sin_addr.s_addr), ac->ac_enaddr);
|
||||
ifa->ifa_rtrequest = arp_rtrequest;
|
||||
ifa->ifa_flags |= RTF_CLONING;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)if_ether.h 8.3 (Berkeley) 5/2/95
|
||||
* $Id: if_ether.h,v 1.12 1995/12/05 02:01:42 davidg Exp $
|
||||
* $Id: if_ether.h,v 1.13 1995/12/09 16:06:54 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef _NETINET_IF_ETHER_H_
|
||||
@ -120,7 +120,6 @@ struct arpcom {
|
||||
*/
|
||||
struct ifnet ac_if; /* network-visible interface */
|
||||
u_char ac_enaddr[6]; /* ethernet hardware address */
|
||||
struct in_addr ac_ipaddr; /* copy of ip address- XXX */
|
||||
struct ether_multi *ac_multiaddrs; /* list of ether multicast addrs */
|
||||
int ac_multicnt; /* length of ac_multiaddrs list */
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user